M340 RS485 communication

brent1

Member
Join Date
Oct 2010
Location
ohio
Posts
1
Hi-

We are using several M340s in different applications. The M340 CPU has an RS232 / RS485 port. Square D has implemented the serial communications such that, when sending a string via RS485, the transmitted string is written the input buffer as data that is read. In programming, we have to strip out the transmitted command.

The purpose of the communications is pretty straightforward, or so we thought. We issue a "read data" request to an instruments using the print_char function.

The method of string termination depends upon exactly how the data is read into the PLC. If the mode is to stop on carriage return ( <CR> ), then the echo of the transmitted command is stripped off the input buffer using one input_char function, then the actual data is read using another input_char function. If the mode is to stop on silence, one input_char is executed, and the returned string is then parsed to extract the data.

The issue is this: whether using either method of reading the data (stop on <CR> or stop on silence), the PLC sometimes "misses" the device's data string - several times an hour based on reading the data at 100ms to 3 second intervals. We know that the device is actually sending the data because we see it in hyperterm - the device never fails to transmit the data. There are no other devices on the RS485 network at this time. This behavior has been seen with a variety of different devices.

Has anyone else seen this behavior? We've got the local distributor applications engineers working on it, but I didn't want to re-invent the wheel if we didn't have to. We also have a tech support case open with Square D, but so far they have been no help at all. The main advice given to us concerned the NOM communications, which we'd rather not go with if we don't have to (although the NOM seems to work fine).

We have run into a slew of other issues regarding the RS485 communications, such as issues with setting the maximum number of characters to read while the PLC is solving, attempting to clear the input buffer (it looks like it's impossible), and other issues that I can't remember. However, we've solved them except for this one issue.

thanks in advance.
 
Hello Brint,

I just saw your post and its seems 10 year old.
Is there anyway you can post the code of that? using the input char two times for reading out the data.
 
Hello Brint,

I just saw your post and its seems 10 year old.
Is there anyway you can post the code of that? using the input char two times for reading out the data.

Pretty unlikely you will get a reply to this as the user has one post and the last time he logged in was to post that question!
 

Similar Topics

Hi all. I'm trying to create a comunication script for a Schneider M340 plc. I've to talk to a Serial converter ( 485 -> 232 ) that talk with a...
Replies
2
Views
2,512
Hey, Long time reader but first time poster here! I need some input/advice with the following problem: I need to write code for M340 that will...
Replies
6
Views
1,617
Hi Everyone, i was hoping for a little help with this module. i have data that needs to be read from a different plc through the Modbus plus...
Replies
11
Views
291
Hello all, I am wanting to update the system clock via NTP in the M580/M340. I'm aware that we are able to connect to a NTP in the controller...
Replies
4
Views
173
I have 9 field devices, three METSEPM5110 power meters and six ACE949-2 rs285 interface modules. I want to read this Modbus rtu data through rs485...
Replies
8
Views
328
Back
Top Bottom