Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Communication via modbus

Hey guys, I have posted this in the labview forum but i havent received much traffic regarding my question perhaps the instrument control board is the correct place for this question.

 

Im looking to switch in my power supply via modbus control. I am using an ADAM-4068, so for instance if i switch the first relay the dc power supply will be on with a voltage level of say 230V, il the second relay switches i want to switch off the dc power and switch in ac power.

 

The ADAM-4068 has 8 relays where i want each relay to control  a piece of hardware. The voltage level is controlled by parameters in the database. I am using the modbus vi library serial master query write multiple coils, But my question is(i am quite new to labview) how can i automatically control the modbus to switch the particular coils to switch in the power supplies.I know my slave address and starting address in the vi. I can run the vi and it communicates to my ADAM no problem.

 

However I have to manually index the array and press the button before i run the vi so select which relays to turn on or off. But my question is how do i control which button/relay is pressed automatically and how would i inturn use that switch/relay to switch in my power supply. For example for my first test sequence relay 1 switches and switches in 100V on DC power supply, next sequence the 3rd relay switches and my AC power switches in or my DMM. I am very inexperienced with labview. So any advice at all is much appreciated.

 

Thanks guys,

 

Damien

0 Kudos
Message 1 of 4
(3,362 Views)

This is really a LabVIEW question and you should start by taking some of the free online tutorials such as this.

 

You should think of the VI that you are using as a starting point. In the final VI, you would have constants on the block diagram and there would be no need to index anything. A simple state machine would have a series of modbus writes with the correct constant values. If you want some sort of options with a user interface, an event structure will work where you might have a Boolean control for each switch and in the value change event, the exact modbus write that you need.

Message 2 of 4
(3,358 Views)

Hi Dennis

 

Thanks for the response i appreciate the information. Where you suggest a state machine with a series of modbus writes, is it possible to get an example where i can try what you suggest?  

 

I am wondering would i need the serial init vi along with the serial master query write mutiple coils or use single coil and for each state assign a constant to coil 1 for state 1, a new constant to coil 2 for state 2 etc? How then can i use the information that coil one is switched in switch in the power supply with xVolts?

 

The main architecture for my project is a producer/consumer loop.But the modbus control is essential to switching in and out the hardware to perform different tests. I greatly appreciate your help and time.

 

Damien

0 Kudos
Message 3 of 4
(3,343 Views)

Hey, is pssible to get an example of what you describe my labview experience is limited nd it would be a great help. Thanks a lot.

 

Damien

0 Kudos
Message 4 of 4
(3,326 Views)