04-25-2021 11:01 AM - edited 04-25-2021 11:04 AM
@MogaRaghu wrote:
The part in grey is from PC to VFD and so should contain the following :
Device address
Function Code
Starting Param Address
Number of registers
Command word
CRC
My query was on the absence of the command word from the real time trace - without this how does the VFD know what I intend to tell it to do ?
With regard to the Modbus library I see only the Plasmionique Modbus Master and the NI Modbus Library in the VIPM browser. Where do you get the one you developed the snippet on ? I have seen this earlier but not sure if its still around ...
I don't know why you call that part "command word". Can you attach a reference to something that calls it that?
That part of the modbus packet is the data. Your function code of 03 defines the message as Read Holding Registers. As a result, you aren't sending any data to the device. You are telling it to send back data. In the response from the device, the data exists and consist of the the two bytes 01 and C1 which is the hex value of 449. Again, it is not a "command word".
If you were doing a Write Single Register (function code 6) or Write Multiple Registers (function code 16), then there would be data in the message packet you send from the PC to the VFD. That data might be a "command" if you happen to be writing to a registers that is expecting a particular numeric value that means something like a start command or stop command or reset, or whatever else that specific register might be looking for.
Have you taken the time yet to read the technical documentation from Modbus.org? https://www.modbus.org/specs.php
04-26-2021 10:18 AM
Function code 0x03 is to read holding register and ox06 is to write data to a function register. Basics.
And that exactly is my issue with the ModScan32 trace. I am not using a function code 0x06 to write the command word aka Register Data ( the image below is direct from Nidec manual ) . Instead I am entering the value 449 into data field and using the function code 0x03 to read. And I hence expect to see the 0x06 function code somewhere in the real time trace. But I dont see it ... so how does the drive get this information and send back the confirmation. ?
04-26-2021 10:24 AM
I'm sorry, but your message doesn't make any sense.
Correct, your modscan32 trace is not using function code 6, it is using function code 3 to read that parameters. That is exactly what your screen shot is showing.
Then you say "Instead I am entering the value 449 into data field and using the function code 0x03 to read. And I hence expect to see the 0x06 function code somewhere in the real time trace". Really? ou are? Where? Modscan32 trace is only reading registers, it doesn't write anything to the registers.
I don't know if Modscan32 trace has the ability to set modbus registers somehow. But the screenshots you show, both in its front panel and its serial port trace shows you are only reading that register.
04-26-2021 11:51 PM
I don't know if Modscan32 trace has the ability to set modbus registers somehow.
After seeing the trace I am convinced that Modscan32 is managing to send my command ( data register value ) to the VFD. Otherwise the VFD will NOT work !
The point is, I enter a value like "449" into the dialog box which pops up when I double click the value field and to send it to the VFD, I expect a 06 function code and this value "449" to be shown in the Write string to VFD. But as you know we cant see it.
I know it does not make sense anyway but thats whats happening.
04-26-2021 11:55 PM
I don't know Modscan. I can only go by what your screenshot shows. And it doesn't show any command that writes a value to the VFD.
Perhaps you already had that value written to the register from some other time?
04-27-2021 11:38 AM - edited 04-27-2021 11:46 AM
Ok some good news finally.
Used the Plasmionique Modbus library and got it going. And to monitor the actual Write and Read data traffic, used the Serial Port Monitor tool. Very useful.
Attaching the quick and dirty VI that worked ... not very neat but does the job. In any case this is not the final one.
Thanks for your support.
04-27-2021 05:36 PM
Glad to hear you got it going.
I see you used a Write Single Register. I've never used Plasmionique, but is it possible that their VI actually does function code 6 to write the data, followed by code 3 to read it back? Because the strings you get back from it are only showing function code 3, perhaps the 2nd of a write/read that the Plasmionique does when you chose the Write Single Register.
04-28-2021 09:18 AM
Thanks for your brain storming which helped to think all possible routes and finally land on a Modbus library as suggested by you.
Appreciate the help.
04-28-2021 11:29 AM
Did you ever attach the link to the MODBUS stuff you mentioned. I didn't see it in a quick scan from that post to here.
Thanks,
