09-27-2010 03:21 PM
I was using a USB 6215 OK. It worked great. However I needed to controll my valves by hardware I/O. I just installed the new USB 6341. I am trying to control 1 line at a time. I am currently sending a binary or hex value to control the valve. It does not act the same way as the USB 6215 DAQ. Does anyone have a simple approch to control one bit at a time. I am not familur as yet with the DAQ USB 6341.
Philip
Solved! Go to Solution.
09-27-2010 03:40 PM
Put the write function before the start function. The write function simply writes data to the DAQ card buffers. The data does not get generated until the start function is called. So in your code, you were telling the DAQ to write an empty buffer before you filled it with data. Try reversing the order and see if it works.
09-27-2010 04:57 PM
Great feedback. I will try your suggestions.
Philip
09-27-2010 08:29 PM
@tbob wrote:
Put the write function before the start function. The write function simply writes data to the DAQ card buffers. The data does not get generated until the start function is called. So in your code, you were telling the DAQ to write an empty buffer before you filled it with data. Try reversing the order and see if it works.
Sorry, putting the Start Task first is normal. Just look at one of the simple examples such as Write Dig Chan.
Philip,
Explain in detail "It does not act the same way".
09-28-2010 07:52 AM
I tried to write to port 2. The scope showed the output to be high always. I read from the users manuel that all of the I/O are defaulted to inputs. So I am in the process of seeing how to change the port from an input to an output.
Philip
09-28-2010 08:16 AM
The DAQmx Create Channel you have sets the lines/ports to outputs. What do you have in the physical channel control?
09-28-2010 09:08 AM
I just figured out the problem. I write to the port via the front panel. Then I start the program with the main start button. I am using 1,2,4,8 as line controls. Next is to creat a 4 channel timing sequence.
Please ignor the two frames after the main flat file
Thank You,
Philip
09-28-2010 11:03 AM
@Dennis Knutson wrote:
@tbob wrote:
Put the write function before the start function. The write function simply writes data to the DAQ card buffers. The data does not get generated until the start function is called. So in your code, you were telling the DAQ to write an empty buffer before you filled it with data. Try reversing the order and see if it works.
Sorry, putting the Start Task first is normal. Just look at one of the simple examples such as Write Dig Chan.
Normal, maybe, but not always so. Look at the example called Write Dig Chan-Ext Clk. It has the write before the start. I guess it works both ways. I have always put the write before the start because I have sometimes used external triggers. That lead me to believe that you have to write to the buffer before you start the task. I do the same with Analog Outputs also.
09-28-2010 11:42 AM
What you stated does make allot of sense. I need to be aware of this for future projects.
Philip
10-20-2022 01:56 PM
Necesito ayuda con un equipo USB-6215, existe alguna referencia que haga lo mismo?
I need help with a USB-6215 device, is there a reference that does the same?