LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VFD - Visa

  

0 Kudos
Message 11 of 46
(2,127 Views)

Hello all. So I am trying to make a VI that would control a VFD using Modbus, and I ran into some problems

 

1.) I made an Modbus I/O server. I configured it to the serial port I needed (COM3), and made bounded variables for the VI that I had made, following this doc https://www.ni.com/en/shop/labview/introduction-to-modbus-using-labview.html (Modbus I/O Servers). Whenever I ran it, an error popped up saying, "The Modbus I/O server failed to send a frame. Ensure that the configuration of the specified serial port for modbus master is correct." (1967353911). I don't know what's going on.

2.) I made another VI in this project with VISA write and read functions, thinking maybe this VI could work. I got an error saying, "The resource is valid, but VISA cannot currently access it" (1073807246).

 

I have since deleted that VI from the project and am using the VI with the 1967353911 error. Here is what I did. For the VI, I tried using "write single holding register" and "read holding register". I figured I would write a value I wanted into the variable (mode is write) shown in the VI, copy that variable and have it set to a read mode this time, put it into the write single holding register, and have that value extracted with the read holding register. I wanted to control the VFD through LabVIEW/Modbus and change its frequency, and to make sure it's working, I would use the same VI to read that output of the same value. I'll continue to work on this, but any feedback you can provide is greatly appreciated.

 

Download All
0 Kudos
Message 12 of 46
(2,131 Views)

Hi chromatic,

 

no need to create double posts/threads for the very same topic. Keep things in ONE place!

(We had a major forum etc. workover, so you cannot expect answers immediatly!)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 13 of 46
(2,116 Views)

You're right. I'm being selfish. It's for a project, and I'm struggling to get this VI working. Time is of the essence, you know? I apologize.

0 Kudos
Message 14 of 46
(2,108 Views)

So I decided to make another VI. I made something simple just so I can see that I can communicate with the VFD, but when I run it, I get an error code 56 "The network operation exceeded the user-specified or system time limit". I'm not sure how to get past this.

0 Kudos
Message 15 of 46
(2,073 Views)

First of all, I would double check that you use the proper interface, proper cabling, settings, etc...

From the attached pdf manual (page number 122):

 

"2. Interfaces
   RS485 or RS232: asynchronous, semi-duplex
   Default: 8-N-1, 9600bps, RTU. See Group b3 for parameter settings.
3. Communication Modes
  1. The communication protocol for the drive is Modbus. It support normal reading and writing of the    registers, also supports managing the function code.
  2. The drive is a slave in the network. It communicates in “point to point” mode.
  3. When there is multi-station communication or the communication distance is long, please connect a 100~200 ohm resistance to the positive and minus terminal of the master’s signal wire in parallel.
  4.FV 100 normally provides RS485 interface, if you need RS232, please choose to add a RS232/RS485 conversion equipment."

 

EDIT: so be sure you use the proper RS485 (RS232?) connectors and cables! From page 17 you can see some related info in the pdf manual...

If you just simply connected a straight serial cable between the PC and the VFD, it might not work. Check the pins what to connect and where! In the manual it shows a 2 wire RS485 cabling: "Standard RS-485 communication port, please use twisted-pair cable or shielded cable."

Do you use a RS232/RS485 converter? Are you sure you use the proper cable between the adapter-VFD, and between the adapter-PC?

 

So maybe the only problem is that, you try to use a simple RS232 adapter? I guess you need RS485! this explain why you cannot make those VIs communicate with that VFD...

 

 

0 Kudos
Message 16 of 46
(2,068 Views)

I'm pretty sure I set up the connection properly. I did use 2 wire RS485 cabling, and used a RS484/RS232 converter to connect to my PC. 

0 Kudos
Message 17 of 46
(2,058 Views)

Hmm, I have found this: https://forums.ni.com/t5/Instrument-Control-GPIB-Serial/Modbus-RTU-read-VI-generates-error-56-timeou...

 

Did you try yet using ASCII instead of RTU? The manual explains how to form "requests" if you use ASCII, and also specifies the termination characters...

 

edit: hm I do not know, if it will help, but try ASCII mode, and use VISA Write first, then after some mseconds delay, a VISA Read command. Page 123 explains how to form the "Request frame", and what you should read using the VISA Read function: "Response frame". There are always start and termination characters you need to use via the VISA Write, then after some msec delay, read out enough length of bytes using VISA Read. You can detect the "Frame header" and the "Frame trail" in each response, you it is easy to parse the info out...

 

Edit2: oh, and do not forget, you also need to calculate checksum when you form a "Request frame"...

0 Kudos
Message 18 of 46
(2,056 Views)

Well, I made an I/O server where I configured it to ASCII, and just ran the first VI I uploaded here. I got an error saying VISA:  (Hex 0xBFFF003E) Could not perform operation because of I/O error.

I got an output, but not only do I not know how to convert into a numeric value, but the VFD's frequency doesn't seem to change accordingly. I know I'm doing something wrong there, but I think it would be best that I stick to Modbus functions rather than VISA.

0 Kudos
Message 19 of 46
(2,041 Views)

Modbus API also uses VISA functions...

By the way, you attached before that "VFD1.vi". If you connect an error indicator right after the "Create Master instance" function, do you see the error msg already there, or it only appears first inside the While loop when your VI executes that "Write Single Holding Register"? By the way, this cannot create an error, but in your VI you have a double control (what you convert to U16) outside the while loop: keep in mind, after your VI executes, the value of this U16 will never change after the while loop starts to run. If you want this numeric control acting as a new input, it must be inside your loop.

 

Either using RTU mode, or ASCII, you need to form your Request frame properly. I refer again to your manual, page 123:

"In RTU mode,there must be a idle of at least 3.5 characters between two frames.It use CRC-16 for data check. Following is an example for read the parameter of internal register 0101(A1.01) from No.5 slave."

 

I have never used Modbus, but I guess to make it work, you need to use the proper frame structure as described in your manual. In that VI what you tried, you simply try to write to a single register repeatedly which is clearly wrong. Lets hope someone with solid Modbus knowledge will appear and help you...

 

0 Kudos
Message 20 of 46
(2,030 Views)