LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

generating a square form signal

Hi Randall,

I need to be looking at the data in real time . However I only need to write that data in a file every second or half a second. I was going to use the example called DAQmx called " Cont Acq&Graph Voltage-Int Clk.vi " in my main VI. Up to now I was used the DAQ assistant with the " differantial mode " and that's what I need to use. I don't seem to be able to choose that mode in the " Cont Acq&Graph Voltage-Int Clk.vi " example. Is it by default? COuld you tell me how to be sure it is configured in that mode?

Thanks a lot,

Marc
0 Kudos
Message 11 of 20
(1,143 Views)
Hi again Randall,

Don't take into consideration my last email. I wasn't looking properly...

Thanks for your answer
0 Kudos
Message 12 of 20
(1,142 Views)
Hello Randall,


To answer your question,I need to acquire data in real time but only wright the info every second or half a second.

1)I am using the labview 7.1 and the example "Acq&Graph Voltage-Int Clk.vi " to aquire data. However, I need to read 7 channels at the same time and this example doesn't seem to enable this ( only one at a time ). Would you know any DAQ mx example that would soot my application?

2) Before trying that example I was using the DAQ assistant. When I compare the voltage red with my SCB 68 card and the voltage read with a voltmeter the difference can sometimes reach 0.2V when I read 1V for example. I am using the differential mode. Do you have an idea of what could create such a difference ( I am pretty sure the problem comes from my program because I am using a very accurate voltmeter ). Could it come from my way of connecting the inputs : ACH0 for V+ and VCH8 for V-.I haven't connected any of the other pins.


Thanks for your help,

Marc




Thanks a lot,

Marc
0 Kudos
Message 13 of 20
(1,142 Views)
Hello,

1/ To acquire several channels at the same time with this example, you have to solution:
- write dev1/ai0:6 in "Physical channel" control. Therefore, you acquire chanel 0 to 6.
- write dev1/ai0,dev1/ai2... in "Physical channel" control. Therefore, you acquire channel 0, 2 and ...

This example only acquire finite points. If you want to continously acquire at every second, it is better using "Cont Acq&Graph Voltage-Int Clk.vi" and specify the sample rate.


2/ You use right connection in differential mode. What de you have in test panel of MAX (Measurement and Automation) ?

On th elink below, you ll find a french knowledgebase about signal connection :
http://digital.ni.com/worldwide/france.nsf/webtechsupp/0E6A8D5999CEE1AF8025683C0056A4B1?OpenDocument&node=163080_f
Isabelle
Ingénieur d'applications
National Instruments France
0 Kudos
Message 14 of 20
(1,142 Views)
Hello Isabelle,

Actually I tried to use the "Cont Acq&Graph Voltage-Int Clk.vi" and it seems to work fine for one channel at a time ( they all work ). I need to aquire 7 differnt voltages through 7 different chanels in a continous way and I can't figure out how to get the 7 chanels at the same time with this example.

Would you have an idea how to do that?


Thanks a lot for your help,

Marc
0 Kudos
Message 15 of 20
(1,135 Views)
Hello again,

Follow this and it ll work :
To acquire several channels at the same time with this example, you have to solution:
- write dev1/ai0:6 in "Physical channel" control. Therefore, you acquire chanel 0 to 6.
- write dev1/ai0,dev1/ai2... in "Physical channel" control. Therefore, you acquire channel 0, 2 and ...

Regards,
Isabelle
Ingénieur d'applications
National Instruments France
0 Kudos
Message 16 of 20
(1,131 Views)
Hello Isabelle,

Thanks for your answer. I got a bit mixed up between the DAQ assistant you advised me not to use for continous acqusition and the Labview example. It's now ok.

I have got another question to ask you. I would like that when " STOP " is pressed, my analogical output sends " O volts ". I have used a global variable to go from the main VI ( where STOP is pressed ) to the sub VI that generates the analogical output.

When I run the program and then press "STOP", the main program stops fine, the second too ( because the square signal isn't generated anymore ) but the voltage stays at either the high or the low level of the square signal depending on when I press.

I think the problem is that it hasn't got the time to send the " 0 Volts " command when " stop " is pressed, and it stops immediatly. Do you think this could be the reason? If so, is there an element I could put in serie between the STOP button and the "round red" one ( that appears in a while loop )that could impose a 500ms wait before stoping the program?


Thanks for your help,

Marc
0 Kudos
Message 17 of 20
(1,118 Views)
Hello again Isabelle,

Could you advise me what to do?

At the moment my main VI has :

- a big while loop containing :
Pressure data acquision
Temperature data acqisition
the assistant DAQ acquring 7 analogic channels

- Outside that loop : The " Cont Gen Voltage Wfm-Int-Clk-Non Regenaration VI" that I have modified to generate either a constant voltage or a square signal. I have used a global variable to " stop " the generation from the main VI.


Here is my question : Relating to what you advised to do, I am using the example " Cont Acq&Graph Voltage-Int Clk.vi" instead of my Assistant DAQ element in the big while loop. Would you advise me to make that example a sub-VI ( + global variables to access the 7 voltages ) and call it from my main VI? Or shall I insert the example ( as big as it is ) in the while loop? Or even outside that loop ( I don't know if will be able to access the data ( see it and right it in a file ) ?

Thanks a lot for your help,

Marc
0 Kudos
Message 18 of 20
(1,117 Views)
Hello,

I dont advise you to make a sub vi of this example.
But you can copy the diagram and ONLY put "read" function inside your big while loop. The "read" function will replace your daq assistant.

If you can avoid gloable variables, it will better for your program.

Regards,
Isabelle
Ingénieur d'applications
National Instruments France
0 Kudos
Message 19 of 20
(1,109 Views)
Bonjour,

Merci pour votre conseil.

Je vais essayé comme ca.

Marc
0 Kudos
Message 20 of 20
(1,099 Views)