RS232 Q12HCPU-PLC with DAQFactory


waayersj

Recommended Posts

Date: 2008-12-16

Subject: problem with serial communication.

Dear,

I have investigated en experimented RS232 serial communication between a Mitsubishi Q-PLC and DAQFactory.

However I have not succeeded to get it works properly.

The problem is DAQFactory can not read/write value

Link to comment
Share on other sites

Actually it says (or should say) it supports A/Q PLCs, not A/Q protocol. Since Q plcs typically support A protocol, this is valid.

Anyhow, can you please post a screen shot or clipboard copy of the serial monitor window so I can see what is being transmitted and received?

Link to comment
Share on other sites

Hi,

I have posted two attachments.

1. RS232_Mitsubishi_Using_Mode1_Protocol.JPG

2. RS232_Mitsubishi_Using_Mode4_Protocol.JPG

These are screenshots monitor communications.

I hope you can analyse more about the problem.

Thanking you in advance.

With kind regard.

post-4096-1229589838_thumb.jpg

post-4096-1229589851_thumb.jpg

Link to comment
Share on other sites

OK, first the only difference between Mode 1 and Mode 4 is that Mode 1 puts a CR/LF pair at the end of the communications. By default, DAQFactory runs in Mode 4, meaning no CR/LF, which is what you have in the left screenshot. The right screenshot is returning a CR/LF so must be in mode 1. You can switch what mode DF uses by using the SetMessageFormat(). For you, to set it to mode 1, you'd do:

device.Q12H.SetMessageFormat(1)

in an autostart sequence. You can also change the CPU type between A type and AnA/AnU type using the SetCPUType command. Default is A type. To do AnA/AnU, do:

device.Q12H.SetCPUType(1)

All changing the CPU type does is changes the two letter command used and the size of the address.

OK, now when I look at the left screenshot, I see the device returning a valid packet, except that it is missing the CRC. DAQFactory is waiting for the two extra characters that make up the CRC and then timeouts waiting for it, thus the Timeout error you are getting. You need to go into the PLC and tell it to output the CRC as well. Once you do that, it should work.

Link to comment
Share on other sites

Dear support of AzeoTech,

With your instructions we have tried again and it is working very well. Excellence!

In autostart sequence we have added the following instructions:

device.Q12H.SetCPUType(0) for A (or Q) (we use Q12HCPU with QJ71C24)

device.Q12H.SetMessageFormat(4) for mode 4 protocol.

In Q-PLC we have configured with CRC.

Also we have upspeed the baud from 19k2 to 115k2.

Now it works good without communication problems.

Thank you for your fast response.

With kind regard.

Waayers :rolleyes:

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.