CODESYS - the IEC 61131-3 automation software

Welcome to the official CODESYS Forum by 3S-Smart Software Solutions GmbH | A member of the CODESYS Group
Deutsche Version English version russian version 
It is currently Thu Oct 18, 2018 9:10 am

All times are UTC+01:00




Post new topic  Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Wed Jan 31, 2018 5:00 am 
Offline

Joined: Tue Jan 30, 2018 6:21 am
Posts: 1
I am currently using CoDeSys V3.5 SP12 trying to grab drab some sensor data using a controller. Let me touch on the hardware architecture first.

Computer -> LAN cable -> Conprosys controller -> RS-232 Serial cable -> CHINO temperature senor

---

I have seen guides on how to open serial com ports using "COM.Open" and such but they are focusing on Computer -> Serial -> Controller. In my case I am hoping to open the Controller SERIAL COM port. I searched for the data sheet and it indicated that the CoDeSys syntax for that controller serial com port being "PORT 1"

Link to mentioned controller (CPS-PCS341MB-DS1-1201): https://www.contec.com/jp/download/cont ... 370d53120a

So how do I actually go about activating that Serial com port on the controller in CoDeSys?


---


Another issue being more of CoDeSys.

When I add Devices in CoDeSys, which do I select for my LAN then Serial configuration?

MODBUS_COM> MODBUS_SERIAL_DEVICE

or

MODBUS_COM> MODBUS_MASTER_COM_PORT> MODBUS_SLAVE_COM_PORT

or

Ethernet> MODBUSTCP_SLAVE_DEVICE

---

This has been confusing me for quite some time now, have no background on CoDeSys. Appreciate any help and confirmation, thanks.


Top
   
PostPosted: Wed Jan 31, 2018 9:23 am 
Offline
Site Admin

Joined: Mon Sep 05, 2005 9:42 am
Posts: 2900
Hello,

which plc are you using, is this Control Win?
I would recommend to the check this examples here:
https://store.codesys.com/serial-com.html
->install it via CODESYS shopping cart and open it then here
'c:\Users\<YourWindowsUserName>\CODESYS Examples\SerialCom\1.0.0.1\SerialCom.project


There are two applications in you need to decide which one is better for your needs (SyscomExample is more low Level based on the syslibs)

If you see the project, there is nothing in the device tree according the Serial communcation... so for plain using the com port
this is not needed.
If you use a higher level protocoll like modbus rtu, then you need to add a modbus serial com port.

BR
Edwin


You do not have the required permissions to view the files attached to this post.


Top
   
PostPosted: Thu Aug 30, 2018 8:52 am 
Offline

Joined: Mon Oct 03, 2016 12:55 pm
Posts: 16
Hello everybody,

I try to execute the SerialCom.project example on my PC (simulation mode) with an USB serial adapter to emulate a COM1 but the opening never work.

The handler is always 16#0! (see below)

Image

I try too on a target but the trouble is the same, handler never found...

Kind regard,

Thomas.


Top
   
PostPosted: Thu Aug 30, 2018 3:28 pm 
Offline
Site Admin

Joined: Mon Sep 05, 2005 9:42 am
Posts: 2900
Hi,
this does not work in simulation mode,
please start Control WIN in your Task tray - and login to this plc on your pc -
then this will work.

BR
Edwin


Top
   
PostPosted: Thu Aug 30, 2018 4:57 pm 
Offline

Joined: Mon Oct 03, 2016 12:55 pm
Posts: 16
Quote:
Hi,
this does not work in simulation mode,
please start Control WIN in your Task tray - and login to this plc on your pc -
then this will work.

BR
Edwin


Thank you Edwin for your help.

I start on Control WIN but the handler is always never found...(see below):

Image


Top
   
PostPosted: Fri Aug 31, 2018 3:09 pm 
Offline

Joined: Mon Oct 03, 2016 12:55 pm
Posts: 16
Thom wrote:
Quote:
Hi,
this does not work in simulation mode,
please start Control WIN in your Task tray - and login to this plc on your pc -
then this will work.

BR
Edwin


Thank you Edwin for your help.

I start on Control WIN but the handler is always never found...(see below):

Image


After many try, I delete all test of the handler value and force to write on the serial port and data are correctly sent...
So, I don't understand what is the problem with the handler but it seems it not correctly fill.

NB: Version of Codesys used is V3.5.13.0.

Regards.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 6 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