LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

First substantial VI, utilising MODBUS

I am very new to Lab view and trying to develop an understanding of the programing structure. Most of my previous programing experience has been with C so this feels like a big shift.

 

What I am trying to achieve is a control panel for a VFD drive that we can use for testing and later integrate into other VIs to assist with motion control. The drive is communicating via MODBUS TCP/IP and a small program confirms that I can start a MODBUS host, query a register and close the connection without generating an error.

 

Moving forward the VI will need to be a lot more complex. I need to be able to set a selection of different variables that are then written to the drive whilst at the same time polling the status registers at a regular interval. On top of this I would like to be able to enable and disable the communication with a toggle switch.

 

I have started out building some of the structure using case statements but I truly dont know what constitutes good 'programing style' when it comes to lab view. Nor do I know the best way to pass and write to variables. Although I have made a start at structuring what I think is the begining of my program.

0 Kudos
Message 1 of 2
(2,343 Views)

If you're very new to LabVIEW I'd suggest doing some of the online material / training / courses. Some of the courses/materials cover application architectures but there's also lots of free information available.

 

There are also lots of examples that come with LabVIEW of different architectures you can use...probably the first things you should look at are State Machines, Producer/Consumer. A very good starting point would be to look for (i.e. Google) "LabVIEW Design Patterns" as these cover most of the standard architectures in LabVIEW.

 

A fairly good architecture to use for this sort of thing would be a producer/consumer with events. You have one loop with an event structure for handling the user clicking buttons / changing values and you have another loop with a state machine or queue which does your modbus communications.


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 2 of 2
(2,323 Views)