From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
11-29-2016 03:56 PM - edited 11-29-2016 04:01 PM
So I put :050602010FA0, but now instead of getting an output, I get an error saying the resource is valid, but VISA cannot access it. I made another I/O server and confiigured it for the VFD, and made the same VI but with normal display for the string this time. I put in the command, and it says that a timeout occurred. I don't know what's going on.
Edit: This has happened several times, It all started from COM3. While tackling this problem with using COM3, 4, 5, and 6 (and now 7), they eventually got the VISA cannot access it error. I checked the properties of the usb, it says they're in use. But they're not. I deleted all I/O servers that used these COMs but they're still in use. Do you know what could be the problem?
11-29-2016 04:17 PM
If you are using an I/O server, then you don't wnat to be using VISA/modbus commands within LabVIEW. You will get "cannot access" errors because the I/O server has already opened that port.
I'm not quite clear on what is going on with your multiple com ports. Are you physically changing serial ports? Changing their names in Windows?
If something says it is in use but is not, then perhaps your VI (or your I/O server) failed to close the com port.
11-29-2016 05:47 PM
Oh I see. Someone said that the Modbus library uses VISA, so I thought that I would have to create a Modbus I/O server in order to use the Modbus/VISA VIs.
And yes, I have been physically changing the ports.
That being said, I would still have the VFD set up so that it would use modbus communication for inputting operating commands, correct?
11-29-2016 06:07 PM
You said the VFD uses modbus, and that it uses the ASCII version of it.
You can
1. Use VISA calls and build all the commands and responses yourself within LabVIEW.
2. Use the modbus library in LabVIEW. It uses VISA within it.
3. Use a modbus I/O server.
You can only do 1 of the above 3 things. Trying to do more than 1, especially with #3, will give you the errors you are seeing.
I'm not sure #3 can handle the ASCII version of modbus. It might, but I've never used created a modbus I/O server.
I always use #2 and is what I recommend you doing.
Doing #1 might work to get you started for a specific command to make sure you can get everything to work. But as soon as you start doing alternate commands, you'll be better off using method #2 instead.
11-29-2016 06:29 PM
Ok. I'll go with #2, then. That would mean that I have to use Write and Read Holding Registers, then. There is a Write Holding Registers VI and Read Holding Registers VI, and there is also a Write and Read Holding Registers VI. I'm assuming it doesn't matter if I use the WHR and RHR VIs or just the one W&RHR VI, since they're practically achieving the same purpose. For the Holding Register value that I want to write, LabVIEW says that the registers are numbers, but ASCII commands, as you said, have 0-9,A-F, Would that mean that I change the data format into hexidecimal so that I put the values from the ASCII line (which are 3A 30 35 30 36 30 32 30 31 30 46 31 30 34 33 0D 0A) as the ones I want to write?
11-29-2016 08:09 PM
Open up the modbus VI's and study them, particularly the ones that define the modbus data unit and create the string from the modbus data unit.
The VI's take U16 values and arrays. So you enter the actual U16 value. Set the U16 inputs to be hex display and enter the values that are on the top line of that example. If you set the mode to be ASCII, then the create string subVI will automatically convert it to the ASCII characters.
The best way to learn is just do it. If one way doesn't work, try the other. And if that doesn't work, study up on the modbus spec and the device's manual some more.