-Menü

Beiträge anzeigen

Dieser Abschnitt erlaubt es Ihnen, alle Beiträge anzusehen, die von diesem Mitglied geschrieben wurden. Beachten Sie, dass Sie nur Beiträge sehen können, die in Teilen des Forums geschrieben wurden, auf die Sie aktuell Zugriff haben.

Beiträge anzeigen-Menü

Themen - Mox

#1
Hello,

I am trying to model Ethernet switches (Moxa EDS-508), and remote I/O (Wago Coupler 750-352) with an OOP approach thanks to Codesys. I am a beginner in Automation in general. Firstly, I succeed to fill these objects with different information through Modbus/TCP Slaves. Which are present in the Codesys Device Tree.

But I wanted to have more flexibility with the modeling. So I imported both libraries OSCAT BASIC v3.3.3 and OSCAT NETWORK v1.2 in Codesys v3.5 SP9. By the way thanks for these great tools.

http://store.codesys.com/oscat-basic.html

http://store.codesys.com/oscat-network.html

My client is the target PLC a Raspberry-Pi, and it sends a Modbus TCP/IP request to the server, a Moxa switch. The switch only works with FC4 and UDP doesn't seem to work. (Error of timeout,16#FF00, is returned).
I choose to make an ST FB based on MB_CLIENT, from Oscat Network. I will use it to read registers and fill the objects. Moreover, I decided to make different FB with different size of data output.

Read_Channel_FB_0 reads a unique Modbus TCP/IP register and release a word output (data_out). It possesses two methods: Read_Parameters_Affec() and Data_Builder().



Read_Channel_FB_1 reads a Modbus TCP/IP register and release an array of two words output (data_out). It possesses two methods: Data_Builder() and Read_Parameters_Affec() (Same method as Read_Channel_FB_0).



A Moxa is modelled by a FB, and composed with two structures: REFERENCE TO Minor_Information, REFERENCE TO Primary_Information. The information represent data more or less important from the Moxa, so the request Modbus TCP/IP are not at the same speed rate between information. Plus Moxa_FB gets a FB_Init to initialize its parameters from a GVL.



Now we build the object Moxa in a program thanks to IP_CONTROL2, from Oscat Network:



When I call the different Read_Channel_FB in a program, there is no error code. And the Moxa_FB is filled correctly.



I wanted to add the Read_Channel_FB inside a new FB: Moxa_new_FB. There are two methods Primary_meth() and Minor_meth().
Plus I removed the use of a GVL for a FB_Init in this FB.



Here is the call in a program:



But the affection didn’t occur. And I don’t have any errors.

I need help, can someone explain me why the object doesn't fill correctly??

Mox.