PLCS.net - Interactive Q & A

PLCS.net - Interactive Q & A (http://www.plctalk.net/qanda/index.php)
-   LIVE PLC Questions And Answers (http://www.plctalk.net/qanda/forumdisplay.php?f=2)
-   -   AD Click and GS2 (http://www.plctalk.net/qanda/showthread.php?t=114537)

Maxkling March 6th, 2018 12:19 PM

AD Click and GS2
 
Devices: AD Click and GS2 - modbus RS232

Need a bit of direction in regards to modbus write(send) instruction.

So far I have set up a read (receive) holding registers(3) with a modbus address of 408449(48449) for a length of 13. It works great and I am also using it to monitor the connection of the drive and plc. The instruction is being called from a rising edge of the 100ms clock (SC5).

So on to the write instruction. I am trying to use the vfd external fault to disable the drive (there is a separate safety circuit with an isolation contactor for an emergency stop). Pretty much the PLC is waiting for an input, once it receives the input it will start a timer. As the timer is timing the drive will be able to be operated via the keypad. The operator can start and stop the drive as well as adjust the speed as necessary (remote keypad).

So for the modbus write instruction, I check that the comm port is not in use, and will write single register (06) to address 402334 (42334) with a single word of either 0 or 1. So here is the problem, I can write a value of 0 to the register as many times as I want, I can write a value of 1 to the register only one time. EF will come up on the drive display and everything is good. But if I write to it again with a value of 1, It will get an error of "CE03" Comm Warning - Illegal data value. My initial logic was to write a 1 to the register constantly until its time for the drive to be used. This was because if I only wrote it one time, the operator could hit the stop button, clear the EF and run the drive. I'm now going down the road of comparing what the PLC wants the drive to do VS what state the drive is in. If there is a difference then, write the updated values to the drive.

My question is why can't I write constantly the same value (higher than 0) to a holding register. I have tried this with different registers and had the same outcome.

Steve Bailey March 6th, 2018 12:36 PM

My first question is why do you think you need to "constantly" write to the address? Once you write a value to an address, the value will be maintained until you (or something else) writes a different value.
Are you trying to write as often as you are trying to read? I think once every 100 mS may be too frequently. I don't know exactly how the drive handles new write requests that come in before it has had time to process the first one, but that could be the source of your error. Try slowing down the frequency of write commands.

Maxkling March 6th, 2018 12:44 PM

Quote:

Originally Posted by Steve Bailey (Post 770956)
My first question is why do you think you need to "constantly" write to the address? Once you write a value to an address, the value will be maintained until you (or something else) writes a different value.

Someone can press the stop/reset button on the drive an clear the EF.

Quote:

Originally Posted by Steve Bailey (Post 770956)
Are you trying to write as often as you are trying to read? I think once every 100 mS may be too frequently. I don't know exactly how the drive handles new write requests that come in before it has had time to process the first one, but that could be the source of your error. Try slowing down the frequency of write commands.

I've tried at many different rates up to 1 sec and even just toggling it to test.

I agree, I can come up with better logic to get around the issue, just would like to know why I can't do it.

Steve Bailey March 6th, 2018 02:22 PM

I expect the answer to why you can't do it is because that's the way the drive is designed. It simply won't accept an external fault command when it is already in the faulted state. The workaround would be to repeatedly read the word and only write a value of 1 to it when you read a value of zero.
Instead of writing to parameter 9.29 have you tried writing to parameters 3.00 and 4.00?

Maxkling March 7th, 2018 07:53 AM

Quote:

Originally Posted by Steve Bailey (Post 770976)
I expect the answer to why you can't do it is because that's the way the drive is designed. It simply won't accept an external fault command when it is already in the faulted state. The workaround would be to repeatedly read the word and only write a value of 1 to it when you read a value of zero.
Instead of writing to parameter 9.29 have you tried writing to parameters 3.00 and 4.00?

Thanks. So I messed around with it a little more this morning and found that if I change 9.03 to 03 "No fault displayed" then the write error code does not show on the display and the drive stay displays EF constantly. Obviously in the logic the write error bit is still high, but the drive acts the way I would have imagined it should have.

I'm going back and redoing the logic to write only as necessary when the PLC values and VFD values do not match.

This is the first time I have messed with modbus and was more or less wondering if its how the drive is reacting to a constant write vs a standard modbus issue. It would seem that as you stated, the drive just doesn't like to be told to be the same value that it currently is. I found this to be an issue with almost all parameters, not just the external fault.

kwade March 8th, 2018 05:01 PM

Quote:

Originally Posted by Maxkling (Post 771036)
This is the first time I have messed with modbus and was more or less wondering if its how the drive is reacting to a constant write vs a standard modbus issue. It would seem that as you stated, the drive just doesn't like to be told to be the same value that it currently is. I found this to be an issue with almost all parameters, not just the external fault.

Modbus is a comms protocol.
It does not know what the data is used for. It doesn't care.
If the '1' value cannot be written to the register if it already contains a '1' value, that is a characteristic of the drive, not modbus. The "CE03" Comm Warning - Illegal data value error is evidence to that.

error code from the wiki modbus page
Quote:

3 Illegal Data Value Value is not accepted by slave

Maxkling March 8th, 2018 06:22 PM

That makes absolute sense now seeing it put that way.

Thanks kwade.

Gene Bond March 11th, 2018 07:55 PM

Quote:

Originally Posted by Maxkling (Post 771036)
<snip>
This is the first time I have messed with modbus and was more or less wondering if its how the drive is reacting to a constant write vs a standard modbus issue. It would seem that as you stated, the drive just doesn't like to be told to be the same value that it currently is. I found this to be an issue with almost all parameters, not just the external fault.

This really seems odd. Virtually all of the comms projects I have done with drives are continuously reading a block of addresses and writing another block.

I've never seen one fault because it was being sent the same value every comms scan... But, I've never used an AD drive before. Imagine an HMI connected to the drive (no PLC) -- The HMI would be the master, and continuously be writing the registers...

What does their tech support have to say about it?

Maxkling March 11th, 2018 08:05 PM

I havenít reached out to them, but might be a good idea.

If I hear back Iíll update.

kwade March 12th, 2018 07:16 AM

@OP
I connected a GS2 to a CLICK. I am seeing the same behavior here.
On GS2 RESET, I can send a SINGLE '1' to 402334. This results in the operator panel indicating 'EF'.
Subsequent '1' to 402334 results in 'CE03'.


All times are GMT -5. The time now is 09:34 AM.

.