ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

solenoid control VI

Hello everyone,

 

I am trying to create a program that controls two servo motors and a solenoid valve using the Labview program and a 6008USB DAQ.  I have the fundamental settings(values subject to change), but i am having trouble with the solenoid portion in particular.  I get an error from the DAQmx Create Channel to the DAQmx write VI.  Im not particularly sure where the error is coming from, the error code is 200429.   I have the VI below, please advise and thank you.

0 Kudos
Message 1 of 7
(4,147 Views)
Quite frankly, I don't think anything in the loops is correct. The 6008 cannot do timed output on the digital and you can only specify a single value to write. You are passing an array (the square waveform) and if it is doing anything, I think it might be writing some subset of the square wave to multiple lines. Is that what you want to do?
0 Kudos
Message 2 of 7
(4,129 Views)

Hello Dennis,

 

No, what i wanted to do was to control the servo motors to move a certain amount using the pulse coded modulator and cause the second servo motor to move after the first one is finished (hence the time delay).  I was following a template that was similar to a post that was already set up here on the NI website.  My goal was to set everything up so that it moved in a sequence of one after the other starting with the servo motors and then the solenoid valve.  When I ran the program, it did not give me any errors for the servo motors so i assumed it would work theoretically even though the amplitude and frequency arent correct for the specific servo motors im using.  I still have to test the servo motors, but i wanted the program to be basically correct before starting.  Any ideas on how to rectify my problem would be greatly appreciated.

0 Kudos
Message 3 of 7
(4,117 Views)

Hello,

 

Since the NI USB-6008 does not have hardware timed digital or buffered analog output or perform counter outputs (the counter gate is not accessible on the USB-6008/6009 devices, therefore used only for simple event counting using PFI0 as an event counter input) you can only do software timed pulse generation. Servos require pulses be sent to them at approximately 50 Hz rate. The pulse width determines the servo angle.  1 msec = 0 degrees, 2 msec = its full rotation typically.  Additionally, in LabVIEW, if you wish to perform a set of functions/code prior to moving to the next set,

you can implement Flat Sequence Structures (Functions Palette»Programming»Structures»Flat Sequence). Hope this helps!

 

Regards,

 

Ali M

Applications Engineer

National Instruments

0 Kudos
Message 4 of 7
(4,078 Views)

Ali M wrote:

 Additionally, in LabVIEW, if you wish to perform a set of functions/code prior to moving to the next set,

you can implement Flat Sequence Structures (Functions Palette»Programming»Structures»Flat Sequence). Hope this helps!

 


Is this how NI recommends achieving proper dataflow?

Richard






0 Kudos
Message 5 of 7
(4,064 Views)

Hello Broken Arrow,

 

I would like to clarify that the statement was intended to point to forcing data flow using Flat Sequence Structures (i.e. optional) for sequential steps (which is entirely user preferred and dependant upon the architecture of application).

 

Thank you,

 

Ali M

Applications Engineer

National Instruments

Message Edited by Ali M on 04-12-2010 05:43 PM
0 Kudos
Message 6 of 7
(4,030 Views)

Ali M wrote: 

I would like to clarify that the statement was intended to point to forcing data flow using Flat Sequence Structures (i.e. optional) for sequential steps (which is entirely user preferred and dependant upon the architecture of application).



OK, that is indeed a way to do it. The OP's VI contains VI's and functions which have error in/out clusters, so wiring those up would be another way to go.

Richard






0 Kudos
Message 7 of 7
(4,021 Views)