Stop the motor (asynchronous) digital NI6008 input

Hello

I want to set up my OEM of NOR-6008 "interrupt" that is call a Windows callback function, when a digital input/output line changes state. I looked at the example ReadDigChan - ChangedDetectionEvent.c , which is the source of the sample and slightly modified for my hardware.  The code is in c ++ and works on Windows XP.  I am doing something wrong in the config or the jury 6008 incapable of interruption I/O-driven?

The code in question is:

DAQmxErrChk (L 'DAQmxCreateTask', DAQmxCreateTask("",&taskHandle));
 
DAQmxErrChk (L 'DAQmxCreateDIChan', DAQmxCreateDIChan(taskHandle,DINPSTR,"",DAQmx_Val_ChanForAllLines));

DAQmxErrChk (L 'DAQmxCreateDIChan', DAQmxCreateDIChan(taskHandle,DINPSTR,"",DAQmx_Val_ChanPerLine)); tried, did not help
DAQmxErrChk (L 'DAQmxCfgChangeDetectionTiming', DAQmxCfgChangeDetectionTiming(taskHandle,DINPSTR,DINPSTR,DAQmx_Val_FiniteSamps,1));
DAQmxErrChk (L 'DAQmxRegisterSignalEvent', DAQmxRegisterSignalEvent(taskHandle,DAQmx_Val_ChangeDetectionEvent,0,ChangeDetectionCallback,));
DAQmxErrChk (L 'DAQmxStartTask', DAQmxStartTask (taskHandle));

'DAQmxErrChk' is a macro defined in the line below

#define DAQmxErrChk (functionName, functionCall) if (DAQmxFailed (s_iError = (functionCall))) {s_iLine = __LINE__; s_szFunctionCall = nomfonction; goto error ;} else}

The error occurs when calling DAQmxCfgChangeDetectionTiming

A call to DAQmxGetExtendedErrorInfo via the macro returns

2011-04-15 @ 14:01 module: InitializeIO, line: 85
Function: DAQmxCfgChangeDetectionTiming

Requested value is not supported for this property value.
Property: DAQmx_SampTimingType
You asked: DAQmx_Val_ChangeDetection
You can select: DAQmx_Val_OnDemand

Task name: _unnamedTask<0>

State code:-200077

I enclose the file c ++ source that contains the NI DAQmx calls for your review as well.

Any help would be appreciated.  Thank you is advanced.

-Neil shore

It does not resemble the 6008 supports a change detection. You can try using a parallel loop structure to monitor the status of the digital line and then put a little more time in a loop to monitor your DI and your change of basis on that.

http://digital.NI.com/public.nsf/WebSearch/8914FA5E30971E0C86256FEF005760FF?OpenDocument

Tags: NI Hardware

Similar Questions

  • Stop the engine when detects digital impulses of the reflective light sensor

    Hello

    I am doing my school project and I managed to make the deepening of the engine via digital port of the USB-6008 by setting the Boolean value of output in a while loop with use cases, but now I faced a problem because I have to use it with a reflective sensor and stop the engine when he feels a digital pulse. The sensor is configured as a counter using PFI0 on the USB-6008 with a circuit that will send in a digital pulse for data acquisition.

    How to stop the engine when the detector reflecting is blocked, and then start the deepening again when it is not blocked

    Thank you

    The top spot is always implemented as a counter.  You must change the DAQmx create channel as a digital input and the DAQmx interpreted as a Boolean variable digital 1 channel 1 sample.

  • Problem with a digital output in the information of an analog input

    Hello

    I use a SCXI-1000DC module with a module of the SCXI-1600, SCXI-1531 module and SCXI-1163 module to receive an analog of an accelerometer signal and a digital signal.
    I claim that the accelerometer is constantly monitored, and the output is on when I want to, by an impulse that I comand in labview.
    I use a rate 25 k and a 12, 5K samples per channel on DAQmx Timing.

    I notice in DAQmx read, if I put a sample of hight by channel, the output is not there when I want to, and if I put a few samples per channel, I exit when I want to, but the program seems to be slow with the passage of time. I don't know how I can solve this problem!

    I'm sorry for my English, and I hope you can help me.

    Thank you

    Silvia

    Hello Silvia,.

    If you ask a larger number of samples, the labview diagram will stay longer in the DAQmx Read function, so the while loop runs slowly, and the digital output is updated less often.

    I suggest that you use 2 separate while loops: one for the analog input and the other for digital output, so that each loop might run at a different speed.

    Best regards

  • Incorrect, test the results of the e/s digital PCI-6024E in MAX

    Hi all

    I have a problem with PCI-6024E. It is for the Commission alone OR installed on a target computer. First he just used OR-traditional DAQ (7.1, if I'm not mistaken) and it worked fine. Some time ago I installed NOR-DAQmx 8.7.1 on the same computer because it is necessary to run both programs written with NOR-DAQmx and NOR-traditional DAQ. As I know there is no harm to do both OR-DAQ and NOR-DAQmx on the same computer if they are not used at the same time. You can see the traditional under NOR-DAQmx devices and peripheral branches DAQ PCI-6024E jury in MAX. When I run the self-test, self-calibration or Reset Device, Max there is no problem. But Test panels (under the direction of NOR-DAQmx) has a rather strange behavior. When I press the "Start" button in tab e/s digital Test panels window with all the digital lines in input, the 4 first green indicators are on and the other 4 are not. And then nothing happens or I press the 'Stop' button or not. I have the same card as a virtual in my MAX on a development computer, and there is a different behavior of it (I don't have traditional DAQ here, just the same version DAQmx). During the entire procedure of test until I press the button 'Stop', the port State 8 lines constantly evolves so the Green indicators are switched on and off with different ways through all possible combinations of logic '1' and '0' in each line of the port.

    The problem is really obvious when trying to control the statements of some laboratory equipment using their passage through PCI-6024E. digital controls. In this case I get auto turn on/off devices connected to the first 4 lines (which are always lit for some reason any as stated that the Green indicators).

    What should I do? This means the Agency is malfunctioning or there is some conflict of data acquisition and acquisition of data-mx? I would try reinstalling DAQ - mx, but I don't think it's a way out of the situation. I work under Windows XP SP2.

    I appreciate all help.

    Igor-

    Your digital outputs will remain in their last State configured unless the device is reset, in which case they will go to the default value (high, in this case).  So if the last State of the low output of your digital program, as long as you do not call the Device.vi DAQmx reset or shut down the computer, they will remain weak.

    If you have other questions about this application in LabVIEW, it would be better to create a new post on the forum so that we can keep these two separate issues (States of I/O digital by default against digital programming in LabVIEW).  If you are looking for a starting point, you can open the Finder example in LabVIEW ('Help' to find examples).  "" Once the example Finder opens, click on input and output material"DAQmx ' digital generation ' write Dig Chan.vi.  This will help you start.

    Better luck with your request and have a great day!

  • How to use Labview to control the motorized turntable?

    Hello

    I am new to Labview and do a project that requires the use of labview to control the motorized turntable (XYZ axes). I need to use the Labview programming and have no idea at all. Need help, thank you very much!

    Lei,

    Everything said by others is correct and to do because they describe, at a given time. But I always approached these projects of motion control first by looking at the 'motion controller' (I hope you have a) and 'drivers' (what you need) between the computer/LabVIEW and engines decide what communications will be required for these devices and get an idea of the syntax of command and the language to use with them.  In some cases, the controller and the motor driver are integrated in a single unit. Heck, in some cases, they are even integrated with each engine.

    The motors can be the stepper motors or perhaps servomotors.

    In the case of drivers stepper (devices that provide power electronics to run the engines), many of them are run using only two control signals for digital called 'step' (a pulse train) and 'direction' (high-low level) and if it is possible to generate directly with the PC, it's an order of magnitude easier (if you have not already a library of available motion control to manage the generation of these signals and) the execution of the stepper motors) of having a "Motion Controller" between the PC and the "motor".  Engine drivers step by step usually can be configured that current engine and the size of the stage and sometimes for the other plus-moteur/driver-parameter setting. The configuration of these can be made with jumpers, switches or, for some drivers, with orders ASCII on some sort of port of communication, but in general these are values you download the installer once at the beginning and then never touch again if you do not need generally to have a full time available on their change communication path.

    In the case of the actuator drivers (once again the devices that provide power electronics to run the engines), many use a +/-10V control input analog signal, and, again, while it is possible to generate the signal directly with the PC hardware, a separate axes controller is usually much simpler and more robust.  In the case of a servo system, there is also a signal back to an encoder or resolver attached to the engine to be used by any device will exercise the motion controller in the system.  There are once again associated with the driver configuration parameters (and controller in this case, since it is part of the servo feedback loop) which must be configured at the start but once set up properly, they rarely need to be changed again.

    A movement controller which is separated from the PC often manage several drivers, and can often coordinate a movement between them. It will load the rise up/down of the engine speed as that changes. It will be followed by position of each motor. The servo system, but it will take the feedback signal and use it to adjust the speed/position/torque of the engine. The motion controller also deal with race and home or index of signals is usually on most lines of movement and provide information of the State of the switch to the PC.   To run the motor controller is then just a matter of chaining a set commands of (usually ASCII) to indicate how fast to run and how far to go (and direction) and by sending a command "do it." Then, ask you to keep track of the status of the process and the States of the switches.

    In many cases the builders of controllers of movement are a primitive way to communicate with the controllers of a PC with no additional software other than what they offer. With this you can at least have an idea of how different the controller commands and responses they produce. That you can start to build sequences of commands to perform the actions you want.

    You can then add LabVIEW to the mix and to understand how you can get it to send sequences of similar orders on the paths of communication that are available and respond intelligently to the information it receives in return for motion control.

  • Closed the motor current continuous Brushless PM and the loop speed control of Induction motor

    I need to implement the speed control of motors, asynchronous Motors PM Brushless DC and several other algorithms of cardiac control using LabView. It will take me 6-channel PWM and 6-channel 12 bit ADC, and a control movement of VI. Ideally a DSP would do the trick, but I would like to take advantage of the user-friendly interface of the LabView program to reduce development time. Please suggest the best hardware solution.

    Vaszzy,

    the SCB-68 is just a connection for the 7842R block and it does not provide a conditioning of signals. You can use digital IO of the RIO card to generate PWM signals. The 7842R provides converters a/d for voltage measurements. To measure the current you will need high precision resistors to convert current into voltage.

    Kind regards

    Jochen

  • back of the motor to the position in which he started?

    Hello

    I am writing an application to control a servo AC motor. It is based on reviews of couple. I use a state machine architecture. The result I'm aiming is,

    (1) the engine operating at a user specified speed and accel/break.

    (2) every time that the couple toggles between the upper and lower, limits the motor direction of rotation is changed.

    (3) at the end (the user specifies no. sometimes he should make this bike) the engine returns to the first zero position in which he started.

    (4) generates the data to the file and stops execution of the program.

    (1) and (2) have been supported. However, I'm still struggling with (3) and (4).

    What I have tried is to take note of the position of the encoder at the beginning of the program, and then after n cycles subtract aware of the position of him and give it as an input in State "Reset postion. Another thing I thought is playing with the tension (the departure of couple cell output voltage is always + 5V) so I thought to call the State "Motor Run" again at the end to move the engine to the original position. I tried some trial and error but am fultile in the efforts.

    No matter who may be likely to help the hand?

    Thank you

    Amandine.

    Hi Sasi,

    in case you have not found your bug by yourself, yet:

    After your state machine has entered the State of the 'RESET' POSITION you start a movement on the 0 position but you should not expect that the move is completed (this should be an additional State). Instead you immediately plug in "STOP ENGINE" and it stops moving without going back to the initial position.

    In addition, there are several things in your code that could be optimized (some examples):

    • By comparing a Boolean value as your STOP button with a constant TRUE is pointless, because the output is always the value of the STOP button. It's sort of a code of Rube Goldberg.
    • Your initialization state runs the same sequence of commands (displacement engine position 0) until button is pressed. There is a large number of redundant orders, sent to the Commission of control of movement.

    Kind regards

    Jochen

  • Sony DVR need data on-screen TV Guide. Rovi will stop the support service of TVGOS from April 2013

    The Sony DHG - disk HARD of 250 and 500 Digital Video Recorders use the calendar to the Rovi's TV Guide on screen (TVGOS) and on an hourly data provided on the signals of broadcasting digital TV channels local.

    Rovi has announced it will stop support of TV Guide service on the screen as of April 13, 2013. The service provides a listing service on the air as part of over-the-air signal from a local TV station. Rovi asked the channels that provide data feeds to remove the insertion of data and return them before the deadline.

    The consequence of this decision is that consumers who have more DVR such as Sony HDD 250 and 500 Digital Video Recorders now with equipment that does not work without the flow of information and the inscription clockset signal.

    Sony has a solution for the owners of digital video recorders?  Is is possible to get the programming data from internet and input sources to the DVR via USB?


  • How can I stop the Firefox "remember" the password for a particular Web site?

    Usually, I like that Firefox remembered passwords. However, I don't want it to remember the password for my Yahoo email account. How can I stop the he remembering only this password, without losing other passwords remembers?

    You can use the following steps to delete the recorded data (form) in a drop-down list:

    1. Click on the (empty) input field on the web page to open the drop-down list
    2. Select an entry in the drop-down list with the mouse or the cursor key
      do not click with the mouse or press the Enter key
    3. Press the DELETE key (on a Mac: shift + del) to delete the highlighted entry

    See also:

    • Tools > Options > Security: passwords: "saved passwords" > "show passwords".

    Details such as websites to remember you (automatically log you) are stored in a cookie.
    So, you can erase cookies from Yahoo to Yahoo forget you, in the case where you put a check mark in the box to have Yahoo don't forget you.

    You can control and manage cookies for the domain currently selected tab:

    • Click the address bar onthe Site identity button"(globe/lock)
    • Click on 'More information' to open ' tools > Page Info "with the Security tab is selected
    • Click on "View Cookies" to view the cookies for the domain currently selected tab
    • Firefox/tools > Options > privacy > "Use the custom settings for history" > Cookies: "show the Cookies".
  • The simultaneous use of two input DVB - T & S - Video on Qosmio G30

    Is it possible, Qosmio player or media library, to have the G30 established to receive a signal from two the built in DVB - T tuner & an external source, such as Sky Digital, connected to the S-video input or Composite?

    The setting in the library seems to insist that you choose one or the other, which seems extremely restrictive.

    Also, if possible, then would it be possible to record one and watch the other?

    The other feature limit seems to be that, despite its hybrid TV tuner, media library allow only one tuner analog or digital set up again, which means that it cannot be used to record from one channel and watch another.

    Hello

    This is a very interesting question, but I guess that it is not possible to do this with the Microsoft MCE.
    Like you said you can use either the analog or digital configuration, but not both together. But of course, you can use standard connectors such as S-video to connect your cable or satellite for your PC Media Center box and then to watch and record TV programs.
    But I don't know if you can do all of m.

    Some Media Center PCs are equipped to handle multiple tuners.
    For example, if your PC Media Center comes with two TV tuners, you can record two programs while watching a third recorded program.

    You know the Microsoft MCE FAQ site?

    Have a look here:
    http://www.Microsoft.com/windowsxp/mediacenter/evaluation/FAQ.mspx

  • Stop the cRIO or sbRIO via command software

    Hello

    After a little digging around I still not found a software command to stop a cRIO or sbRIO. There is a restart vi, but not a stop. I wonder if I missed something that someone may know.  For a RT Linux RIO it may be possible using a Linux command, I wonder? And for a VxWork, an idea? THX

    L.

    In general, it does not resemble the power management is not very well supported. Looks like there is a command to do it on Linux RT systems:

    How should I stop OR Linux Devices in real time?

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

    I have done some research and there is a little more information in the following forum post, and it seems that there are some utilities for Windows that are not available for RT.

    The start distance and stop the controller SMU running Labview RT (WoL)

    http://forums.NI.com/T5/LabVIEW/remote-startup-and-shutdown-of-of-PXIe-controller-running/TD-p/24496...

  • stop the script with labview

    Let's say that I run a script using the "DIAdem"run script.vi"due to the demand of the user.  Later, the user wants to cancel because it took longer than expected.

    How to stop the script using labview tools?

    Jim

    Hi Jim,.

    It is possible, but not in the way I think you hope.  I don't know any way to end a VBScript script running in the DIAdem of the 'outside '.  If you have been watching DIAdem you could hit the key, but a subsequent application of LabVIEW goes in "Script stack" of DIAdem and does not run until the first VBScript happens naturally.

    Of course, you need to run all your calls of LabVIEW to Sophie in an asynchronous way, or does not.

    If you can do is set up each VBScript that you think you might want to abandon to periodically query a global variable of tiara, say "B9" and end of inside the VBScript if B9 = TRUE.  LabVIEW DIAdem (ToCommand) command interface will stack Script tiara, but variable interface of LabVIEW DIAdem (ToDataSheet) does not work.  If you can "poke" during execution of the first VBScript variable B9 of LabVIEW and influence its behavior, but only if and when this VBScript uses this variable (B9) get bitten.

    Of course, none of this helps if your VBScript is busy waiting for a simple VBScript command to run, and it helps only if your VBScript executes several activities, among which it can interrogate the variable (B9).

    Hope that helps,

    Brad Turpin

    Tiara Product Support Engineer

  • I want cRIO to start and stop the acquisition by push physical button on the cRIO, is this possible?

    When you use my cRIO 9024 on the ground, I prefer to be able to start and stop the acquisition with pressing a physical button on cRIO.

    I want to say I don't want it to be "as a start-up," I don't want cRIO to start the acquisition as soon as the power supply is ensured.

    Is this possible?

    Hi Cashany,

    you will surely find this switch status. But there are easier ways (but more expensive) for a button. Fiddling with a pen or a small screwdriver to switch USER1 is not what I call "user friendly"...

    -You have at least 2 voltage inputs on your module available. Use a switch voltage on the power inputs. Use a 'real' button!

    -You have an available serial port. You can set some pins on GND or voltage and check their status inside the cRIO/RT target...

  • How to secure the wiring of digital output BNC-2090

    Hi, I'm working on using the digital output of data acquisition to control the digital DAC input, but I have a problem on how to fix the wiring for the digital output of the DAC. When I plug the cable into the hole, it is vaguely related. Any suggestions on how to fix the wiring are appreciated.

    Thanks in advance!

    It is a spring terminal.

    Try to push in the orange tab with a screwdriver while pushing in the thread.  Release tab to release the wire, and it must grab and hold the wire.  It may be a case involving Orange instead of push.  You should be able to understand.

  • How can I use internal clock case OR USB - 6259 BNC for the acquisition of digital data in my own big software?

    I want to integrate the ANSI C sample program ReadDigPort - ExtClk.c in my own big package.

    I want to use the internal clock of the BNC NI USB-6259 (.. 80 kHz 120 kHz).

    In the document:
    High speed M: Series Multifunction DAQ for USB - 16-bit, up to 1.25 MECH built-in BNC connectivity. / s,.
    is written:
    Or sample DI source clock: Any PFI, RTSI, HAVE sample or convert clock, AO, Ctr n out internal and many other signals sample clock
    The digital subsystem doesn't have its own dedicated internal synchronization engine. Therefore, a sample clock must be provided another subsystem on the device or from an external source.

    How can I use internal clock case OR USB - 6259 BNC for the acquisition of digital data in my own big software?
    With what other subsystem on the device can generate a source of the clock? How?

    It is possible to set a clock on an internal counter (for example ' Dev1/ctr0"):
    Creates channels to generate digital impulses that define the freq and dutyCycle and adds the channel of the task that you specify with taskHandle.
    DAQmxCreateCOPulseChanFreq (taskHandle, "Dev1/ctr0" units, clockName, idleState,
    initialDelay, freq, the duty cycle); works

    But it is not possible to drive this internal clock to a terminal (for example "/ PFI0/Dev1"):
    DAQmxErrChk (DAQmxCreateCOPulseChanFreq (taskHandle, "/ PFI0/Dev1", clockName, units, idleState, '))
    initialDelay, freq, the duty cycle); does not work: error DAQmx: measurements: type I/O of the physical channel does not match the type of I/O required for the virtual channel you create. Name of the physical channel: PFI0. Name of the virtual channel: clock

    The sample clock source can be derived from an external terminal (for example "/ PFI0/Dev1"):
    Sets the source of the sample clock, the sample clock rate and the number of samples to acquire or generate.
    DAQmxCfgSampClkTiming (taskHandle, "/ PFI0/Dev1", maximumExpectedSamplingRate, DAQmx_Val_Rising, ")
    DAQmx_Val_ContSamps, bufferSize); works. Acquire or generate samples until you stop the task

    But it is not possible to derive the internal counter of the clock (for example ' Dev1/ctr0"):
    DAQmxCfgSampClkTiming (taskHandle, "Dev1/ctr0", maximumExpectedSamplingRate, DAQmx_Val_Rising,
    DAQmx_Val_ContSamps, bufferSize); does not work. Error: Acquire or generate samples until you stop the task: make sure that the name of the terminal is valid for the specified device. See Measurement & Automation explore valid names of terminals. Property: Property of DAQmx_SampClk_Src: DAQmx_SampClk_ActiveEdgeSource device: Terminal Source Dev1: Dev1/ctr0

    Hi datafriend,

    using what it says is correct:

    Or sample DI source clock: Any PFI, RTSI, HAVE sample or convert clock, AO, Ctr n out internal and many other signals sample clock
    The digital subsystem doesn't have its own dedicated internal synchronization engine. Therefore, a sample clock must be provided another subsystem on the device or from an external source.

    This means that if you do not use an external signal as clock you can use the sample clock to HAVE it on board or at the output of the internal counter.

    There are also 2 ANSI C examples in this regard:

    http://zone.NI.com/DevZone/CDA/EPD/p/ID/4485

    http://zone.NI.com/DevZone/CDA/EPD/p/ID/4488

    So in both cases you have to use a fictitious task you need only for the generation of the internal clock (HAVE or CTR)

Maybe you are looking for