Jump to content

Recommended Posts

Hello,

 

I want to send 8 bytes of data from a microcontroller to the PLC and display it. I am using a V1040 with a V200-18-E5B snap-in module.

I am using MAX232DW IC to convert UART to RS232 from the MCU. 

At the moment the MCU is sending the following bytes 1 time per second: 0x23 0x05 0x50 0x05 0x50 0x05 0x50 0x05 0x50 0x2B 

The first byte 0x23 is the start byte and the last byte 0x2B is the end message byte.

 

Do I have to include the start and end byte in the message length?

 

And do I need to do something with the DTR and DSR signals of the RS232 connector? At the moment I am using a 2 meter long 4 pin RJ11 cable, where pins are in the following order - GND, RxD, TxD, GND. So I am sending from the MCU to the PLC's RxD pin and from the PLC to the MCU from the PLC's TxD pin (Sending not implemented yet). The cable is a straight cable. The DIP switches which choose between RS232 and RS485 are set for RS232. 

 

I watched the seminar about the FB protocol and made the ladder exactly like that, minus the message. 

 

I am expecting to recieved the message above.

 

I have included the project file aswell.

 

The plc does not recieve any messages I am sending. I check with the online "glasses" and the Session byte stays 0 all the time.

 

Does anyone have any idea what could I be doing wrong?

 

Thanks in advance!

 

T

COM2_test.vlp

Link to comment
Share on other sites

An update:

 

The PLC recieved only the 0x23 aka '#', which is supposed to be the start of the text byte.

 

Numbers of bytes recieved stays at 0.

 

Did I understood correctly that the PLC converts the recieved ASCII into a DECIMAL value?

So If I send a 0x05 then it converts to it to ENQ (enquiry) ?

 

Update during writing of this post:

 

I sent 0x23 0x05 0x50 0x05 0x50 0x05 0x50 0x05 0x50 0x2B and the PLC displayed "*P*P*P*PP". Changed SCAN protocol variable to Stream with a vector length of 5 and convert 2 bytes to one linked element.

 

EDIT: FB protocol was all about sending ASCII - I can do that now.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...