joseph_cs

QJ71C24N-R4: G.INPUT and G.OUTPUT

9 posts in this topic

Currently working with a Q02HCPU where I have installed a serial module QJ71C24N-R4 in effort to read display temperature data from a device via RS485. The device request an ASCII command with CR (no line feed) where the command is "01ms." which is "30 31 6d 73 0D" in HEX. 

To begin, I used G.OUTPUT to transmit the request of "01ms." in ASCII from Channel 1. My ladder then follows it with a G.INPUT instruction. My start I/O is 240 and I have configured all data format (8 data bit, even parity, 1 stop bit, non-procedural protocol) using Intelligent Function Module - Switch Settings. Lastly, I wrote all parameters and ladder to PLC and rebooted power as instructed by Mitsubishi. After turning everything back on, I am receiving Parity and Framing errors. 

I have attached several pictures of the Circuit Trace to show send/receive packets as well as the switch settings. Has anyone seen this before? If so, what could be causing a framing / parity error even after having correct switch settings?

 

Thank you

SwitchSettings.JPG

CT_080919.JPG

Share this post


Link to post
Share on other sites

@Wasan Is that necessary even if only using Channel 1? Channel 2 is not being touched. 

Share this post


Link to post
Share on other sites

If you need to use echo back function you need to use CH2. For CH1 you should write some insrtuction to check that data that you recieve are same as data that send if yes ignore them.

Share this post


Link to post
Share on other sites

I am currently not receiving any data at all. After reading more of the manual, it seems to me like I shall be using Pre-defined Protocol instead of Non-Procedural since I am communicating with an external device. Since I am not using Channel 2 at all I did not touch any echo back functions. 

In addition, using a hyper-terminal I confirmed the transmission G.OUTPUT instruction to be executing the necessary command. The problem is that I am not reading any temperature data at all. Has anyone monitored data using G.CPRTCL instruction instead using INPUT/OUTPUT?

Share this post


Link to post
Share on other sites

Try and use a different baud rate, I noticed when I was setting up a serial barcode scanner that if the baud rate was not correct, I would not get the data or it would not make sense with the data that input. Not sure if that is the problem, but I would try it. Also as you noted previously, anytime you make a parameter change you need to either reset the CPU or cycle power to it, either one works, if not the changes will not take effect.

Share this post


Link to post
Share on other sites

@joseph_cs Which protocol that your device use? If ASCII or non protocol you can use Nonprocedure protocol but if Modbus you should use Predefined protocol or use QJ71MB91 to communicate with them.

Share this post


Link to post
Share on other sites

@Wasan @Asaddoris The external device is a pyrometer with "UPP" (universal pyrometer protocol) all it needs is to see a ASCII request with the proper command ("01ms+CR") and it will respond with the reading temperature. I have confirmed this using a hyper terminal. 

I am using Non-procedural protocol and G.OUTPUT/INPUT instructions to transmit the request and read the incoming data. The problem is that I am not seeing anything come in, it is not reading. The PLC is currently spitting out framing and parity errors, which is odd because I have written all switch settings in respect to the data format of the pyrometer (external device). 

Share this post


Link to post
Share on other sites

@joseph_cs You should check these methods.

1. Check communication parameter (BaudRate, Data Bit, Stop Bit, Parity Bit) and then match setting in QJ71C24N-R4 and your device.

2. Try to use G.Output first then check by use USB to RS-485 on Serial Monitor software to check format that data send from PLC.

3. After that create G.INPUT sequence then use Serial monitor Software to send data to PLC.

4. Connect PLC with device and then test sequence.

(Option) Use CH2 instead to connect data by disabled echo back function.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now