LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Help with DAQmx write line/port

Dear users

 

For a project with Labview I have to create and compare the characteristics of a photovoltaic panel (note: school related). First of all I have to turn on power outlets with DAQmx, which then triggers the lamps. These will produce a voltage-output on the photovoltaïc panel and then I'll run the Yokogawa GS610 from within labview to run a linear sweep and import the results.

I have created a basis state machine in which the user can select how many lamps (power outlets) should be enabled to acquire the results. Each state gives feedback to an LED on the front panel. 

 

I'm currently stuck with turning on the relays from DAQmx. I used the DAQ-assist and selected port1/line 0 which turns on the power outlet number 1. The problem is that I have connected a boolean from the LED's to the data-input from the VI, and so if I switch to another case with my enum on the front panels, the power outlet stays high. 

Any solutions or improvements on the view of the program for your side?

 

I'll add my project in attachment, there are some trials in there as well, but the main file should be untitled project. 

Thanks in advance.

 

0 Kudos
Message 1 of 5
(2,870 Views)

Hi MatthiasT,

 

I have just taken a quick look at your project and before we even address the specific issue you are having I would like to suggest a couple of good coding practices. i would have a look at the "Simple State Machine" Template from the LabVIEW splash screen where you create a new project. From what I can tell you seem to want to implements certain things based on a change and this may provide a good way to wait for a User Event and use clusters and shift registers to pass data between different states (a powerful tool for data set manipulation and reduce your local variables).

 

This will then add flexibility when manipulating states. By passing data from one state to the next you can then write the desired result to the DAQ device. You add in more states where you actually want to do specific things such as write to your DAQ device or turn on or off. Writing down the state machine and the desired transitions and things that happen in each will help you understand what you need to do and when.

 

Hope this helps.

 

Kind Regards,

 

Matt Fergusson

 

0 Kudos
Message 2 of 5
(2,802 Views)

I agree with mferguss that a State Machine will be helpful.  But you need to get rid of the Dreaded DAQ Assistant (DDA, for short).  Do a Web Search for "Learn 10 Functions in NI-DAQmx ..." and learn how easy it is to do things with about 4-5 DAQmx functions.  You'll want (if you use a State Machine) to separately control Configure Task, Start Task, Read/Write, and Close Task, with each ideally in its own State.

 

Bob Schor

0 Kudos
Message 3 of 5
(2,791 Views)

Dear Matt

 

I noticed the importance of a state machine. The DAQ-connection works completely now, the only problem we have left is importing the measurements from our Yokogawa GS610, but the problem is in the commands towards the machine.

The source level is sended correctly, but the measering procedure doesn't get activated on the machine itself, so we don't have an values to import.

 

Thanks for your help!

This is what I have now, still some bugs in it but on the good way.

 

With kind regards

Matthias

0 Kudos
Message 4 of 5
(2,777 Views)

Dear bob,

 

I replied to your collegue with what I have now.

 

Thanks for your reply!

 

With kind regards.

0 Kudos
Message 5 of 5
(2,774 Views)