PFC200 sending a message via serial port (using a non-standard protocol)

I want to implement a program in e!cockpit in ST language. I need to connect to the device via rs232 using the non-standard MEGATEC protocol and send the power-on command.
How can i do this? Are there any examples of connecting using a non-standard protocol?

I’m afraid there is no example project.
You should try using the WagoAppSerial_Scanner library.
This is intended for communication with barcode scanner, but looking at the MEGATEC protocol it looks the principle is similar. You can send command, and you have an answer with starting char and ending char.
If the behavior of the function block doesn’t fit, you should use a lower level library such as the WagoSysSerial.
You’ll have to handle the Tx and Rx buffer by yourself.

1 Like

Hi @Kazz,

Your friend for this is the Library WagoAppCom.

unfortunately there is no example project available.

You can connect the Internal COM Port of the PFC or use a 750 IO Module to connect with the Functionblocks.

You need to handle the Buffers by checking the ReceivedBytes until the Delimiter of the Megatec Protocol appears in the Buffer.
Can be done like that way:

image

2 Likes

I don’t see anything complicated. You send a command in ASCII format and receive the response, it’s better to do it in a loop in time. The main thing is to choose which commands you want to receive.