CODESYS - the IEC 61131-3 automation software

Welcome to the official CODESYS Forum
Deutsche Version English version russian version 
It is currently Fri Jul 28, 2017 4:02 pm

All times are UTC+01:00




Post new topic  Reply to topic  [ 8 posts ] 
Author Message
PostPosted: Wed Mar 01, 2006 6:36 pm 
Offline

Joined: Wed Mar 01, 2006 6:32 pm
Posts: 4
Is there a library that offers the ability to send a character string out through the host computer's serial port?

Jason


Top
   
 Post subject:
PostPosted: Thu Mar 16, 2006 11:01 am 
Offline

Joined: Wed Jun 01, 2005 7:31 am
Posts: 9
Hi,

What about SysLibCom?

It allows to open/close serial ports, and to read/write data from/to them.

Or are you looking for something different?

Arie N. Verheul


Top
   
 Post subject:
PostPosted: Wed Mar 22, 2006 10:28 pm 
Offline

Joined: Wed Mar 01, 2006 6:32 pm
Posts: 4
I thought that was what I should use, but I can't seem to interpret the examples that I have found online. Can anyone post some working POU's with SysLibCom?

Jason


Top
   
 Post subject:
PostPosted: Thu Mar 23, 2006 2:54 pm 
Offline

Joined: Wed Jun 01, 2005 7:31 am
Posts: 9
Jason,

I've done quite some RS232 interfacing between CoDeSys controlled PLC and other equipment.

Basically I've one task handling one serial port, with one 'low-level' POU (FB) handling basic RS232 actions (sending requests and receiving responses) and a 'higher-level' POU (PRG) determining which subsequent requests to send based on received responses.

The higher level POU is continuously calling (polling) the low-level POU, checking it's status to determine if the low-level POU has finished transmitting the current request, or has finished reading the expected response etc.

The low-level POU is a state machine with several (job)states and several (job)results, and it's only this POU that uses the functions from SysLibCom

Some extra states are needed because the low-level POU is only sending a certain amount of bytes at a time, and also is reading a certain amount of bytes at a time, before handing over control to the higher-level POU (so that eventually also other tasks can get a chance to run).

States:

JOB_IDLE: (* Do nothing *)
JOB_SEND_REQUEST: (* Send request *)
JOB_SEND_REQUEST_CONTINUE: (* Send more bytes from (large)request *);
JOB_WAIT_FOR_ANSWER (* Wait for response *)
JOB_WAIT_FOR_ANSWER_CONTINUE (* Wait for more bytes from (large)response *)
JOB_PROCESS_ANSWER (* Process response *)
JOB_RETRY (* Send request again *)

Results:
STATE_READY
STATE_BUSY
STATE_TIMEOUT
STATE_WRONG_ANSWER
STATE_TRANSMIT_ERROR
STATE_INIT
STATE_NOT_USED

Arie N. Verheul


Top
   
 Post subject:
PostPosted: Thu Mar 23, 2006 8:10 pm 
Offline

Joined: Wed Mar 01, 2006 6:32 pm
Posts: 4
That sounds like a good idea, similar to what I would like to set up.

I have tried using syslibcom.lib, but can't get even the SysComOpen function to work. My plc is configured with the target system being a PCI card with an integrated PLC installed inside my computer. This card does not have any serial ports, and I am hoping to use the host PC's RS 232 port, not a port on the target card.

I have duplicated the code from this post on the German board:
http://forum.3s-software.com/viewtopic. ... hlight=232

but it cannot successfully open COM2.

Is this possible?


Top
   
 Post subject:
PostPosted: Mon Oct 06, 2008 1:15 pm 
Offline
User avatar

Joined: Tue Oct 16, 2007 10:16 pm
Posts: 16
anverheul : Is it possible to have a copy of the source?

Best regards,
Frank


Top
   
PostPosted: Tue Sep 27, 2016 12:49 pm 
Offline

Joined: Fri Sep 11, 2015 12:39 pm
Posts: 16
bump: any updates to this? :)


Top
   
PostPosted: Fri Sep 30, 2016 7:59 pm 
Offline
Frequent User
Frequent User

Joined: Thu Jun 14, 2007 9:49 am
Posts: 974
check the codesys site

_________________
shooter@home.nl
computer shooter
paul deelen
jacob van wassenaerstraat 29
NL 5224 GG 's-Hertogenbosch
skype shooter paul.deelen
phone +31736139136


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 8 posts ] 

All times are UTC+01:00


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited