You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

---------->>>>>Get FREE PLC Programming Tips

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

PLC training tools sale

Reply
 
Thread Tools Display Modes
Old March 6th, 2018, 01:19 PM   #1
Maxkling
Member
United States

Maxkling is offline
 
Join Date: Mar 2011
Location: Atlanta
Posts: 193
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.
  Reply With Quote
Old March 6th, 2018, 01:36 PM   #2
Steve Bailey
Lifetime Supporting Member + Moderator
United States

Steve Bailey is offline
 
Steve Bailey's Avatar
 
Join Date: Apr 2002
Location: The boondocks of Western Massachusetts USA
Posts: 6,629
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.
  Reply With Quote
Old March 6th, 2018, 01:44 PM   #3
Maxkling
Member
United States

Maxkling is offline
 
Join Date: Mar 2011
Location: Atlanta
Posts: 193
Quote:
Originally Posted by Steve Bailey View Post
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 View Post
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.
  Reply With Quote
Old March 6th, 2018, 03:22 PM   #4
Steve Bailey
Lifetime Supporting Member + Moderator
United States

Steve Bailey is offline
 
Steve Bailey's Avatar
 
Join Date: Apr 2002
Location: The boondocks of Western Massachusetts USA
Posts: 6,629
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?
  Reply With Quote
Old March 7th, 2018, 08:53 AM   #5
Maxkling
Member
United States

Maxkling is offline
 
Join Date: Mar 2011
Location: Atlanta
Posts: 193
Quote:
Originally Posted by Steve Bailey View Post
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.
  Reply With Quote
Old March 8th, 2018, 06:01 PM   #6
kwade
Member
United States

kwade is offline
 
Join Date: May 2013
Location: sc
Posts: 310
Quote:
Originally Posted by Maxkling View Post
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
  Reply With Quote
Old March 8th, 2018, 07:22 PM   #7
Maxkling
Member
United States

Maxkling is offline
 
Join Date: Mar 2011
Location: Atlanta
Posts: 193
That makes absolute sense now seeing it put that way.

Thanks kwade.
  Reply With Quote
Old March 11th, 2018, 08:55 PM   #8
Gene Bond
Member
United States

Gene Bond is offline
 
Join Date: May 2004
Location: Indianapolis, IN
Posts: 289
Quote:
Originally Posted by Maxkling View Post
<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?
  Reply With Quote
Old March 11th, 2018, 09:05 PM   #9
Maxkling
Member
United States

Maxkling is offline
 
Join Date: Mar 2011
Location: Atlanta
Posts: 193
I havenít reached out to them, but might be a good idea.

If I hear back Iíll update.
  Reply With Quote
Old March 12th, 2018, 08:16 AM   #10
kwade
Member
United States

kwade is offline
 
Join Date: May 2013
Location: sc
Posts: 310
@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'.
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
CLICK & GS2 modbus Tom@Pton LIVE PLC Questions And Answers 2 March 15th, 2016 12:24 PM


All times are GMT -5. The time now is 09:21 PM.


.