LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Preparing a VI for a VFD

Hello, all. So I have been looking up examples of how a VFD is controlled by LabVIEW / Modbus, to create a similar VI for a VFD that will soon be hooked up to a computer. I would like your feedback to see if my VI seems to be right so far. The thing is, this VI is theoretical, and I would like to extract the frequency when the VFD is hooked up, and I am not sure how to go about doing that. This is for a project that will usea VFD, a PLC, and an motor, so I would like to know how I can go about putting the PLC in the following VFD VI.

VI Background: I made event cases where it would start the VFD, stop the VFD, and completely stop the VI, and I followed the tutorial of "connecting LabVIEW with any PLC using Modbus". One more event case is present ([0] Timeout), and that is where I want to extract the VFD output frequency (and perhaps be able to change it from LabVIEW and make it so that it would serve as an input to another VI in that event case).

0 Kudos
Message 1 of 14
(2,302 Views)

Edit. I again used New TCP master, connected it to "Read input register", put the register value to a "convert to sgl " vi, and put an indicator afterwards. Through that wiring, I used the "convert to sgl" output for the type x input of "type cast", put a constant ("0") for the type input, and put an indicator for the type cast output. I feel like I'm going in the right direction, but I would like some feedback, if possible. 

0 Kudos
Message 2 of 14
(2,248 Views)

Hi chromatic1,

 

You seem like you're off to a good start. If you haven't yet, it would be good to read the manuals of your Modbus hardware to learn about the specific commands and registers you will need to use.

 

One change I would suggest would be creating the Modbus master before the While Loop / Event structure. You could reference the "Modbus Library" shipping example to give you more ideas on how to structure your code.

 

Another thing you could try is creating a slave in LabVIEW with the same registers that you will eventually talk to, and try communicating with this slave. This could make the transition to the real hardware easier later on.

 

I hope this helps!

 

Lauren D

Applications Engineer

National Instruments

0 Kudos
Message 3 of 14
(2,224 Views)

Lauren, thank you for your suggestions. I was going over the manual for the VFD and found that rather than a TCP/IP connection, it must connect through a serial connection. I'll be going the modbus library and take your suggestions into account so that I may adjust my VI accordingly. One other thing that I came across was that my VFD will be connected to a PLC, and I am not sure how I can make it so that the PLC will obtain the frequency value of the VFD. How can I go about establishing a connection between a VFD and a PLC onto a VI in labview? I will contact the PLC's company and ask about any APIs that may come into play soon.

0 Kudos
Message 4 of 14
(2,193 Views)

Hi chromatic1,

 

How are you connecting to the PLC in LabVIEW? Once you connect to the PLC, then you should be able to use the PLC's communication methods to talk to the VFD over serial. You should be able to find that information in the manual or from the third party company.

 

Lauren D

Applications Engineer

National Instruments

0 Kudos
Message 5 of 14
(2,169 Views)

Hello, Lauren. I was going to connect the PLC to the computer via USB, I had just begun downloading the software that corresponds to the PLC model. For connecting the PLC to LabVIEW, I started by following the tutorial that NI provided, titled "Connect LabVIEW to Any PLC With Modbus". I already made the resulting VI. I would think that after connecting the PLC to the computer, It's just a matter of making sure that LabVIEW knows that the PLC is connected, so it can properly execute the VI.

0 Kudos
Message 6 of 14
(2,145 Views)

Hello, Lauren. I have a couple of questions. You said that once I connect to the PLC, then I could use the PLC's communication methods to talk to the VFD. By communication methods, do you mean how I followed the NI tutorial I mentioned before? If so, would that also mean that I would have to put the coils I defined for the VFD and PLC into 1 VI? If that's the case, I don't know how to go about doing that. I was able to make a serial VI for the VFD, although I just followed an example I saw online. Am I going in the right direction?

0 Kudos
Message 7 of 14
(2,101 Views)

The most recent VI you attached is serial communication, which I am assuming was to connect with the VFD, not the PLC since the PLC is connected over USB. 

 

From my understanding, your line of communication is LabVIEW>>PLC>>VFD. LabVIEW talks to the PLC, and the PLC talks to the VFD. LabVIEW is not directly talking to the VFD, which is why I don't think that the VI you attached will work unless the VFD is directly connected to your computer running LabVIEW.

 

You should be able to talk with the VFD through the PLC by using whatever commands / API / etc are provided with the PLC, which should be outlined in the manual. I hope this helps explain the communication process.

 

-Lauren

0 Kudos
Message 8 of 14
(2,073 Views)

Hello, Lauren.

I apologize for the late response. Thank you for explaining the communication process. However, it seems that my group may not use the PLC for our project, which leads me to a problem. The VIs I made so that LabVIEW can talk to the VFD would theoretically allow me to extract the frequency that the VFD provides. I don't know if my VI will work unless I directly connect the VFD, but that is not what is troubling me the most. For our project, I would like to make it so that I could use LabVIEW to change the frequency of the VFD (so that the output frequency that I extract change accordingly, and allow the motor to change frequency accordingly as well). What would be the best way to go about this issue?

0 Kudos
Message 9 of 14
(2,041 Views)

Does the VFD's manual have serial commands for changing the frequency? If so, then you should be able to use the VISA functions (specifically, VISA Write) to communicate directly with the VFD connected to the computer.

 

-Lauren

0 Kudos
Message 10 of 14
(1,989 Views)