Design practice nor 6008 USB DAQ

Hello

I have a few question, I'd like to introduce. I need some sort of indication on how to better perform a timed cycle of acquisition driven by WSF.
I'll send my VI (conceptual, not one currently working one) and ask for explanations.
The goal

I need to acquire a battery voltage. Load current consumption is driven by a couple of transistor.  I drive the hollow transistors two digital i/o for USB data acquisition.

Because I need to have a power for a given time cycle, I need to have some sort of time control on the output.
So I wrote a simple state machine whose States are updated when a timer reaches zero. Each State has its own queue time.
Moreover, I differentiate between acquisition and control operations using two all in cycles.
First question: is this a correct way to a timed WSF of construction?

and now:

The problem (s):

I need to connect and establish a correlation between the input line for the internal of the fsm States. So I madesome digital indicator on the face before of the VI and created a local variable (I know that local variables are BAD, but I had no other idea everything) to pass values for some time to the other.

I also want to select State sequent of the FMS based on the input value, I get a channel. I can stil use a local variable?

Are the two related tasks?

Second question: are local variables, something that I can use for this task?

Last but not least: I need to filter on the values.
In this vi I perform a filtering operation and then I get the I use for control of local variables.

will be this filtering desync the two cycles while? will I run out of control before running the filtering?

The same question is valid for the purposes of registration: the unfiltered data record, I guess is unnecessary. But based on this 'architecture' I know the country reports and the recorded signals are out of sync (as happens in many game data acquired with this vi).
Is this a problem of logging (perhaps given by different buffers for data acquisition and internal State or something similar) or the whole WSF will be out of sync, then all acquired data is more useful because it is out of sync?

Any advice would be much appreciated.

Best regards

Luca.

Luca,

Question 1: This is a reasonable start but need some things to make it a good WSF. There is no waiting or delay in the loop so it will run as fast as possible. U.S.-6008 outputs digital software timed so that the DAQ Assistant can take a long time, but the amount of time is unknown and not necessarily consistent from iteration to iteration. Since the DAQ Assistant Analog Input in the other races of loop to<= 10="" iterations="" per="" second,="" a="" wait="" of="" 100="" ms="" in="" the="" fsm="" loop="" seems="" like="" a="" good="" starting="" point.="" waiting="" 3000="" ms="" is="" not="" a="" good="" idea="" because="" the="" loop="" becomes="" unresponsive="" to="" the="" stop="" button="" for="" long="">

Do you need to write on the lines on each iteration, even when the data has not changed? Add a write state that is called only when the data changes.

The DAQ Assistant has a Stop input and an output of Stopped. When you are ready to stop the loop, the stop signal must be wired to these inputs so that the DAQ Assistant can delete tasks. The output of the order can be connected to a Terminal to stop the loop.

Problem (s):

It seems that you want to link the two loops.  Local variables are usually a bad way to do it. The best way is to use queues.  A queue can send the current state of the file loop. (More comments later if that's really what you need). Another line can send data, or better, the commands, the loop of the file to the loop.

I think you want digital output values rather than the State. Especially if you add a State writing as I suggested above, the current state will not always represent the condition of the power of your test.  To make this work with the additional state Boolean matrix must be moved from one iteration to another via a shift register.

It seems that you have at least two controls to be sent from the loop of the file to the loop. One is the stop command. The other went to the higher power level control.  You should probably have a command to set off power level which can be used if the battery voltage becomes too low and before stopping.  How your program is currently configured, the last level of power will continue as long as the power of the computer is on and the USB-6008 is always plugged. The cessation program does NOT reset the lines.

When you use anti-parallel to the queues, you must be careful on the definition of wait times and the timed out case management.

The benefits of the queues are that it is easy to ensure synchronization at the level you need, the data can be stored according to the needs, and there are good examples. It also avoids the possibilities of race conditions, often introduced by local variables.  This program could be based on a variation of the design producer/consumer model.

Filter questions: any filter introduces a time delay. In your case when you filter 100 samples 10 times per second, it is likely that the filter will do well until the next data set has arrived. The delay of the filter is not affecting your synchronization. The above lines will solve problems.  Since you are looking at time of cycle seconds and the minimum interval on the order of 100 ms, the exact chronology (to tens of milliseconds level) is probably not too important.

The real question about filtering boils down to this: does the control work better if the signal is filtered?

- - - - -

I'd probably all this a little differently. Given the slow speeds and the small amount of data, a simple loop with an improved state machine is all that is needed. Get rid of the DAQ Assistant and learn how to use DAQmx screws.  States could include: Init THE Init, Init File, Idle, read, write, DO, Analyze, filter, adjust the power, wait, Save, close file, DO, AI Shutdown Shutdown, error and exit.  No variables. No indicator fake just to allow the creation of local variables. Very little code outside the structure State case. None of the queues.

Lynn

Tags: NI Hardware

Similar Questions

  • problem with loopback test base with NOR-6008

    I recently started to use DAQmx in c# .NET 4.0 with NOR-6008 USB DAQ. I tried a loopback test by connecting output to an analog input analog and tried readign the signal from the output to the entrance but did not send the signal (or maybe a problem with the code). The analog input readign reads a random value rather than the value entered by the user for the output. I connected ao0 and ai3 on data acquisition. Here's the code.

    private void button1_Click (object sender, EventArgs e)

    {

    Task analogOutTask = newTask();

    AOChannel myAOChannel = analogOutTask.AOChannels.CreateVoltageChannel ("Dev1/ao0", "myAOChannel", 0, 5, AOVoltageUnits.Volts);

    AnalogSingleChannelWriter writer = newAnalogSingleChannelWriter (analogOutTask.Stream);

    Double analogDataOut;

    analogDataOut = Convert.ToDouble (AnalogOut.Text);

    writer. WriteSingleSample (analogDataOut, true);

    }

    Private Sub button2_Click (ByVal sender As Object, EventArgs e)

    {

    Task analogInTask = newTask();

    AIChannel myAIChannel = analogInTask.AIChannels.CreateVoltageChannel ("Dev1/ai3", "myAIChannel", AITerminalConfiguration.Differential, 0, 5, AIVoltageUnits.Volts);

    AnalogSingleChannelReader reader = newAnalogSingleChannelReader (analogInTask.Stream);

    Double analogDataIn is reader. ReadSingleSample();

    AnalogIn.Text = analogDataIn.ToString ();

    }

    Hello

    I built an application using your code (with task.verify) and it works beautifully.

    Have you tried different channels of inputs/outputs?

    Curt

  • NOR-6008 selection file Matlab .m voltage range

    Hi, I need to select a range of power such as - 1V to + 1V file .m in MATLAB to acquire data of acquisition of data NOR-6008.

    I appreciate if someone can send me a code example.

    The system works very well and I can control successfully the sampling frequency, but not the voltage range.

    Concerning

    Hello

    The two alternatives are equivalent, option 2 is how to get to a channel if you had not registered to a variable when it is created.

    When you say that it doesn't work, do you have an error message?

    I just tried it on my machine with an NI USB-6008 with 4 channels and the range set to-1 [1] on one of these channels:

    > s = daq.createSession('ni')

    s =.

    Session data using National Instruments hardware acquisition:
    Will work for 1 second (1000 scans) to 1,000 scans/second.
    Some channels have been added.

    > s.addAnalogInputChannel ('dev2', 0:3, "voltage")

    years =

    Session data using National Instruments hardware acquisition:
    Will work for 1 second (1000 scans) to 1,000 scans/second.
    Number of channels: 4
    index of Type channel MeasurementType range nom_peripherique
    ----- ---- ------ ------- --------------- ---------------- ----
    1 THE Dev2 ai0 (Diff) voltage-20 to + 20 v
    2 THE Dev2 ai1 voltage (Diff)-20 to + 20 v
    3 THE Dev2 ai2 voltage (Diff)-20 to + 20 v
    4 THE Dev2 ai3 voltage (Diff)-20 to + 20 v

    > s.Channels (2). Range = [1-1]

    s =.

    Session data using National Instruments hardware acquisition:
    Will work for 1 second (1000 scans) to 1,000 scans/second.
    Number of channels: 4
    index of Type channel MeasurementType range nom_peripherique
    ----- ---- ------ ------- --------------- ------------------ ----
    1 THE Dev2 ai0 (Diff) voltage-20 to + 20 v
    2 THE Dev2 ai1 voltage (Diff) - 1.0 to + 1.0 v
    3 THE Dev2 ai2 voltage (Diff)-20 to + 20 v
    4 THE Dev2 ai3 voltage (Diff)-20 to + 20 v
       
    Properties, methods, events

    > s.inputSingleScan

    years =

    -0.0034 0.0008 0,0059 0.0012

    Wael Bruno

    The MathWorks

  • A better way to make a continuous read/write on a NOR-6008

    Hello

    I use a USB of NOR-6008 module and have a loop of the software configuration where I acquire analog signals, digital signals, then, then put a digital high or low and repeat. I use digital multiplex outside the material so that I can use 6 of the analog inputs to read 12 signals. The digital inputs that I have are connected to the buttons on a panel that are used for the entry instead of the screen of the computer of the user. My loop is also to build a buffer zone of all the signals on the analog and digital lines that I read in so I can on average and this process elsewhere in the program.

    The question that I am running is because this loop is very slow and on the final product is performed on a touch screen, XP Embedded PC and just this acquisition loop begins again as much CPU as the rest of my program. I would say that drops of loops on 4 or 5 cycles per second, which means that my update of 2 multiplex signals or longer than a second time. I would really like to better performance and does not use as much of my CPU resources.

    I use a way simple enough to make the loop of the acquisition, by setting the parameters I, reading, deleting the task, defining the parameters DI, read, erase the task and then by setting the parameters, write about it and delete the task, which gives a slight delay and repeat.

    Any thoughts on a better way to start the read/write that what I'm doing?

    I have attached the code examples in the loop of the acquisition that I use.

    Thank you!

    First of all, the best plan is to move the chain DAQmx before the loop to create and use a start DAQmx, then write in the loop, then clear once the loop ends.  This configuration must be done once, not every time you write the channel.  This should speed things up considerably.

  • USB DAQ error after update to 15.1 DAQ

    Everything worked well (DAQ 9.5) on my windows XP SP3 machine, so I thought that it's a good idea to install the last DQA 15.1, NOW my USB DAQ has a Red Cross in NI MAX and does not

    I tried to reinstall OR DAQ 15.1, restarted the PC, plug the NIDAQ inside and out, but the error remains.

    Any ideas how to solve this problem?

    Thanks for the info. I tried the above and uninstall and reinstall everything, but in the end, the only thing that solved the problem was to install a new copy of the operating system, windows XP in this case.

  • I2C implementation using NOR-6008

    Hello world

    I have a NOR-6008 low cost multifunction data acquisition.

    Can I use this with shifter voltage level to apply the I2C Protocol...

    You must use the approach of bit - strike (i.e., change you the clock and data lines yourself) and it would be timed by the software. But yes, you could do.

    Your next question will be: are there examples? There are many examples on the conduct of IO digital who settle with DAQmx. Regarding the implementation of I2C, the spec is available. http://en.Wikipedia.org/wiki/I%C2%B2C

  • USB6363 DAQmx (reading and writing) calendar seems slower than other similar USB DAQ devices

    Hey people,

    I have currently a service waiting number with OR the subject, but I thought I'd post up incase anyone has ever dealt with a similar question pertaining to USB DAQ hardware.

    Try to understand why there is a difference of synchronization between the 6363 USB and some of the other less expensive USB devices like the 6525 or 6501.

    It's a watered the actual code that my team has noticed this difference in the simplified version.  The actual code is a reading analog daqmx (it's triggered hw, so we begin the task of analog playback, trigger, wait the time we acquire to and then run reading daqmx. who takes 6 ms to read a single 50 values of the buffer).

    Thank you

    -Pat

    Hi Pat,

    Try benchmarking of HAVE it read that way (with the wait timed by the software, it seems to me that the task is probably not yet made to the time you want to read - I guess that the question is relative between the event of the task performed and all the data is available in the DAQmx buffer, I don't have a series of X USB to see) :

    Try benchmarking your writing clocked by the software in this way (there no reason to include the check/reserve/validation/start sequence in your writing of reference when the task can easily be launched during initialization of your program):

    On my PCIe X Series as the two cases take< 1="">

    Best regards

  • Writing USB DAQ: Reading the data, analyze, analyzed data - does not

    I have Labview 2011 32 bits (without tools), on Windows 7.

    Material: Enclosure OR USB - 6251 DAQ board.  I use analog analog out.

    I'm trying to collect data (reading), analyze (like part or derivative) to a new waveform (or a data table)., then convert them this new waveform. As in this example:

    http://zone.NI.com/reference/en-XX/help/370466V-01/mxcncpts/hwtimedsimio/

    However, I don't have hardware timing.

    I tried a lot of things. Those who work temporarily, until the start to write task threw an error: http://i.imgur.com/as5ItdO.png

    Another who work temporarily, but it has a 7 second delay: http://i.imgur.com/VLbyZbo.png

    Ends up having this error: Warning 200015 occurred

    When writing to the buffer during a regeneration, the actual data generated may have alternated between the old and new data. In other words, while the pilot was replacing the old model of the buffer with the new model, the device could have generated some new data, while a part of the old data and then a part of the new data again.

    Reduce the sampling frequency, use a larger buffer or refer to the documentation on DAQmx write me for more information on other ways to avoid this warning.

    Can someone tell me what I'm missing?  It seems very simple.

    Thank you.

    Thank you for an update. Sorry I missed you use hardware USB DAQ and this is the reason why we see this error

    http://digital.NI.com/public.nsf/allkb/EC1968728E660B288625780700570D06?OpenDocument

    In general, when you receive errors like that they give you a pretty good idea on what is going on. Therefore, you can try to remove your task AO timming daqmx or try to set the size of the buffer.

    This might help

    http://digital.NI.com/public.nsf/allkb/E1E67695E76BA75B86256DB1004E9B07

  • E4407B works not with NOR-GPIB-USB-HS

    My E4407B Agilent does not work with my NOR-GPIB-USB-HS. I tried two different E4407B Agilent and 2 different NOR-GPIB-USB-HS, so I doubt it's different devices. The E4407B will not be displayed in the solutions of measurement and Automation Explorer. I tried fiddling with the matching settings listed here, but without result. What I need to make this work? I spoke in support of agilent and they claimed it wasn't my NOR-GPIB-USB-HS, settings on the Analyzer.

    Nevermind, I figured it. The NOR-GPIB-USB-HS is apperently not make good contact with GPIB port on the monitor, even if it is screwed to the bottom. I plugged the adapter to a GPIB cable, then GPIB cable to the parser, and it worked fine.

  • Integrate USB DAQ 6008 program Labview

    I'm new to LabVIEW and am currently writing a vi to access the 6008. I'm using LabVIEW 2012. I installed the driver NOR-DAQmx 3.6, however, the sample code is code c - no vi. Also, I can't see examples of NOR-DAQmx in the finder of the example. I downloaded various examples, but each are missing Subvi which I believe should be installed with the driver. All advice is appreciated.

    Harry,

    1 DAQmx Base is only supported on Mac OS.  You can find petitions on the exchange of idea ask for better support.

    2 DAQmx and all its beautiful examples are not installed on the Mac.  This means that the measurement and Automation Explorer (MAX) is not installed on the Mac and things such as the DAQ Assistant exist (although it is not a great loss).

    3. when DAQmx Base is installed on Mac OS X with LV 2012 you should have the DAQmx Base screws accessible from the measures of e/s palette.

    4 installation DAQmx Base includes a bunch of examples in this direction: Applications: National Instruments: LabVIEW 2012: examples: daqmxbase: However, the example Finder doesn't seem to know they are there, then you will need to manually search.

    One good thing about DAQmx Base is that it is almost entirely written in LabVIEW, so you can see what he does.

    Once you get past the obstacles, the USB-6008 case works well with DAQmx Base and the Mac.

    Lynn

  • Continuous output signal using usb DAQ 6008 in matlab


    Hi Takou,

    You already post with the same subject. Is this the same thing, isn't?

    If so, refer to the following link:

    How to get out a sinus with usb 6008 on MATLAB

    http://forums.NI.com/T5/Multifunction-DAQ/how-to-output-a-sine-with-USB-6008-on-Matlab/m-p/1510508#M...

    Best regards

  • order bipolar motors with usb DAC-NOR-6008

    Hi, I need help for an example vi that explaining how to order two bipolar stepper motors using the USB-OR-6008 data acquisition card, I have the engine drivers, can any body help me?

    you are more than welcome... OK, I've attached a vi that could help you... I will illustrate how to connect your driver for your usb data acquisition card.

    1. on the digital I / side P O/P of data acquisition is a 5V pin, connect it to the two 5V pins (pulse and Direction) of the driver.

    2 - 2 other pins (Pul - and Dir-) connect to port0/$line0 Pul-and port0 / line1 to dir.  (you can configure the ports like u as in the vi block diagram window).

    3. allow the PIN to activate it without a connection. (it is normally activated).

    for the connection of the motor: (do not connect these pins for data acquisition)

    It has 6 pins.

    first of all, you must know the motor coils wires, you could test with any counter AVO.

    1 - the first pin is connected to the mass of the battery.

    2 - the second pin to the positive pole of the battery.

    3, 4 the first whorl.

    5, 6 the second coil.

    Try it and I hope that I helped you, tell me if it worked.

  • USB-6008, USB-6501 and Embarcadero C++

    Hello NEITHER and NOR users,.

    I spent a considerable amount of money several years ago on a number of devices USB-6008 and USB-6501 for a class that I teach on interfacing the simulations with realworld sensors and actuators.  Write us code using Embarcadero C ++ Builder and we wrote the code to interface with the jury of EZIO AD / DA via RS - 232.  The EZIO is much too slow and limited.  Given advertising NOR, we bought these boards, but after several attempts to get some information OR on the way to talk to these devices directly via C++, we have yet no valid response.  No, I don't want to LabView or any additional expenses.  I just want to talk to them directly.

    OR: are you ready to help with this, or not?  If this is not the case, although wanting to refund these purchases.  Announce as being accessible from C++, but you are not willing to provide any help of substance to this day...

    Yes, I am self-taught, write code, and old-school enough to feel that I have a right to know how to talk to all the devices I buy.  I confess my ignorance, but I'm sick and tired of secret corporate and misleading advertising.

    Can someone please provide me with enough example of code to start.  That's what we wrote for the EZIO:

    http://www.Duke.edu/Web/ISIS/Gessler/Borland/RealWorld-Ezio.htm

    We would like to start writing similar code for these materials of NEITHER.  If possible, we can buy more.  If this is not the case, these cards are useless.

    Kind regards

    Nick

    Nicholas Gessler, PhD.

    Nick,

    When you have installed the DAQmx drivers to communicate with the 6008 and 6501, I assume you also installed programming examples? It is here that they are on my XP machine: C:\Documents and Settings\All Users\Documents\National Instruments\NI-DAQ\Examples\DAQmx ANSI C.  I don't think that Embarcadero C++ Builder is one of the languages supported, so you'll need to twist your compiler, but it should give you a good start.

    Tom

  • Ghost NI USB DAQ card readings

    Hello

    I have a question about the behavior of the NI USB-6218 data acquisition card.  Right now I use Labview to take several current readings of different channels to HAVE it.  I use resistors 250 ohms for each channel just as the instructions say to make the current readings.  I had an incident where he has been disconnected one end of a resistance at the entrance to the port.  I expected to see the reading go to zero, but instead, he began to piggback off the coast of reading one another channel give me a kind of 'reading ghost' because there was essentially no current crosses.  Playback of disconnected channel displayed the current reading of the canal connected even while values went upwards or downwards.  Can someone explain why the DAQ card would do that? and anyway to avoid this to happen?

    Thank you.

    A data acquisition uses a multiplexer to send a signal to the ADC.  Due to having only 1 ADC, you will get this effect if the ability has no way to bleed.  There is no way to avoid this if you disconnect the side DAQ, leaving the open input channel.

    You could try adding in some amplifiers specially designed for the shunts of currents.  I have used TSC103IPTwith success.  This amplifier gives you a single output is completed.  But I don't know what will happen with these if you disconnect one side of the resistance of the amplifier.

  • Serial RS232 directly to a USB DAQ?

    Hello

    I have a question about serial communication: is it possible to directly connect a device through RS232 serial to digital pins of an acquisition of data USB-6211? (Or perhaps even a USB-6008?)

    If so, where should I wire the pins to?

    If this isn't the case, could you recommend me a not too expensive, but functional RS232 to USB adapter that could work well? (I plan to interface a capnometer Datex or an infusion of Fresenius pilot C pump first, but if I could find a relatively cheap multi-port adapter I'd both. BTW, can I include more NI-VISA requests in parallel in LabVIEW?)

    Thank you

    No, you cannot use a DAQ hardware to simulate a serial port.

    I do not have a specific recommendation for a seller, but I've had much better luck with adapters built with a chip from ftdi than others. Google "usb to serial adapter".

    You can have multiple threads of communication with several cards.

Maybe you are looking for

  • satellite 2430 wirles-lan card is not supported by windows xp

    I have a MPC13A-20/R internal WiFi card in my satellite 2430-201 and downloaded and installed the driver updated (wlesslan-xp-7620390) of toshiba.The material is recognized, but do not configure.Windows xp gives me the article standard Vegetto 871122

  • Your text suddenly not working on more than 6

    I have an iPhone 6 +. I used the tone 'Bulletin' for my texts, but he disappeared. I turned off my phone while I was in a theatre, 3 days ago and when I turned on the tone of the text was missing. It is checked and is the only tone that has stopped w

  • How to improve the performance of XControl?

    Hi all LabVIEW 2009 + DSC Following project example, there are 1 XControl and tester.vi. My goal was to display object flexible to build (1 XControl) because my user interface varies a lot depending on the current configuration of the client. The amo

  • Error Code 8007000D install Windows updates

    I'm running Windows 7 on a Lenovo X200S.  Windows Update worked until about a month or two ago and has since been giving me "unknown error code' 8007000D.  I ran the Mr. Fixit tool in aggressive mode and it did not help.  I downloaded and installed K

  • Does HP Elitebook 8440p support WWAN

    My HP Elitebook 8440p has a SIM slot, but wanted to know if my phone is supported. How do it know?