11-24-2016 02:27 PM
So I am trying to go about this in a different way. Now, I am trying to see if, rather than tell the VFD what frequency it should run at, I will try and have the VFD tell LabVIEW what frequency it has. After that is said and done, then I will work on telling the VFD a frequency to operate at. So I changed the Modbus Master Instance into Slave, took off that numeric control, and change the function code to read holding registers. I am not getting any errors anymore, but I don't know how to get the frequency.
11-24-2016 02:48 PM - edited 11-24-2016 03:05 PM
@chromatic1 wrote:So I am trying to go about this in a different way. Now, I am trying to see if, rather than tell the VFD what frequency it should run at, I will try and have the VFD tell LabVIEW what frequency it has. After that is said and done, then I will work on telling the VFD a frequency to operate at. So I changed the Modbus Master Instance into Slave, took off that numeric control, and change the function code to read holding registers. I am not getting any errors anymore, but I don't know how to get the frequency.
Regarding to the manual, the VFD is ALWAYS in slave mode. So do not change that, the PC must be the master.
edit: I would really try that you commit a VISA Write, and lets say after a 50 msec wait, a VISA Read (the manual says there need to be at least a 10 msec wait between a Request and Respond). The manual explains what to send with the VISA Write. I guess the same can be done with the high level Modbus API functions, but the same should work easier with the basic VISA functions. I already referred several times to the manual. Why do not want to test it? Modbus is a request-respond type of protocol! I cannot test it for you, I do not have your VFD device...
EDIT2: some further reading about how to calculate checksum, etc...: http://forums.ni.com/t5/Industrial-Communications/Modbus-RTU-RS-485-communication-with-Mitsubishi-VF...
11-24-2016 03:12 PM - edited 11-24-2016 03:30 PM
Also have a look at the attached pdf file for a Request frame forming example, page 4 describes the RTU and ASCII modes. ASCII is easier since it is human readable...
edit: you can also test using RTU modes, since there are many Request frame examples (like how to start motor go forward, etc.) at the very end of your user manual (VFD user manual-1.pdf)!
11-24-2016 04:12 PM
Ok. Per your suggestion, I will forget Modbus and work with VISA for the moment. Thank you for the links. I'll be sure to look over them.
So I am going to try the ASCII request frame in page 123 to test it out. Would I do a concatenated string? Like I type in each of the characters in each string, then convert them to hexadecimal, and then combine them together, and that would be my code?
11-24-2016 04:44 PM
I put together a little test VI, based on the example from your manual. Could you test it? I might made mistakes with the hexa values... I used the NI modbus files from here: http://www.ni.com/example/29756/en/
Unzip the content, and copy the corresponding files into the VI.lib and user.lib folder (like c:\Program Files (x86)\National Instruments\LabVIEW 2015\user.lib\ , etc.). Restart LabVIEW if needed.
11-24-2016 05:05 PM - edited 11-24-2016 05:34 PM
I'll test it out. I can't seem to put in any letters for the registers (can't put in C7)
I'm gonna stop here and work on it tmrw. I appreciate all the help you have given me, Blokk. Thank you. Happy Thanksgiving.
11-24-2016 11:09 PM
C7 is not a letter, but a hexadecimal value. You can right click on the control, and change the view from decimal to hexadecimal. In this way easier to copy values from the manual. Anyway, happy holiday, and i still hope someone more experienced with Modbus (or in general) will jump in and clarify these things for us. I have some idea what to try, but I do not have the device to quick tests 🙂
11-24-2016 11:55 PM
By the way, the png file I attached above to my post, is a LabVIEW snippet. It also holds the VI. So you can drag it into an empty block diagram, and you get my VI functionally (so having already the U16 control array set to show hexa format, etc...).
11-25-2016 12:22 PM
So I'll stick with VISA for now. I guess I wanted to use the Modbus VIs because I felt like the whole process of communicating with the VFD via LabVIEW was much more complicated. I guess I was the one that made it more complicated than it was. Anyway, so I made a VI just to test out commands. I tried to do the ascii command in pg. 123. I put the write buffer in "\ Codes Display" and all the characters in the string command with the backslashes appropriately positioned, but now I get the warning 1073676294 (I have 0 bytes at port), and I can't get anything on the read buffer. I don't know how to fix it. (The command is :\05\06\02\01\0F\A0\r\n)
11-25-2016 03:04 PM
Did you try my test vi with Modbus?