Quantcast
Channel: Digital I/O topics
Viewing all 2182 articles
Browse latest View live

dual spi device with one master and one slave on the PC end

$
0
0

The powers that be want to emulate a hight speed RS-232 connection to an instrument we are building. We don't want to poll the instrument to see if it has data. They want the instrument to have both master and slave SPI busses so that it can push data to us.

Dual SPI.png

I need to find the PC hardware to do this that is compatable with LabView so I can test it. It doesn't have to be a single device. It could be two as long as one can be master and the other slave. We have the NI USB-8452 but it can't be slave.

 

TIA  Norm

 


HSDIO trigger for repeated acqusition

$
0
0

I am using a PCI-6541 with the NI-HSDIO interface to attempt to acquire a signal. I would like to start the acqusition on a trigger signal for a set number of samples, download those samples, and start a new acqusition upon detection of another trigger from the same source. I managed to get streaming to memory without the re-trigger, and the start trigger works correctly, but it acquires continuously, not only upon detection of the trigger edge. How do I have to configure the system to achieve my goal?

 

Many thanks

 

Dave

dsc

$
0
0

Hola , soy estudiante de automatizacion y robotica actualmente realizo un proyecto de vision artificial que he realizado en labview y sus modulos de vision and motion,DSC, Vision assitant el proceso es detectar tipos de frutas y sus defectos y el actuador es un brazo de ABB IRB120 con controlador IRB5 Compact ,la comunicacion se realiza por medio de OPC, He realizado todo el proceso. El problema que se  presenta es que las señales creadas en no cambian su estado hay comunicacion entre el controlador y la interface de usuario en labview . Por ejemplo el pulsador de marcha no cambia su estado y por consiguiente el robot no recive el estado que deberia, para de false a true y activar  la rutina principal programado,me gustaria saber si alguien me podria dar una idea por que aunque se ven  las señales booleanas, estan estas no cambia.


He configurado el ABB OPC configuration como el servidor y Opc como cliente en laview ( OPC server 2013).


Agradeceria me ayudaran.

 

Hi, Iam a student ofAutomation and Roboticscurrentlyconducted aprojectartificialvisionthatI made inLabVIEWandmodulesvisionandmotion, DSC,Visionassistantthe processis to identifytypes of fruitsand weaknessesand the actuatoris an armofABBIRB120withIRB5Compactcontroller, thecommunicationis by meansofOPC,Imadethe whole process.Theproblem that arisesis that the signalscreateddo not change theirstateno communicationbetween the controller andthe user interfacein LabVIEW.For examplethestart buttondoes not change itsstateand therefore therobotreceivesthe stateshould,forfrom false to trueand activate thescheduledmain routine,I wonder ifsomeone couldgivemean ideathatalthoughthey seeBooleanthesesignalsarenot changed.


I configuredtheABBOPCas the serverconfigurationas a customerand Optionslaview(OPCserver2013).


Iwould appreciatehelp.

dsc

$
0
0

Hola , soy estudiante de automatizacion y robotica actualmente realizo un proyecto de vision artificial que he realizado en labview y sus modulos de vision and motion,DSC, Vision assitant el proceso es detectar tipos de frutas y sus defectos y el actuador es un brazo de ABB IRB120 con controlador IRB5 Compact ,la comunicacion se realiza por medio de OPC, He realizado todo el proceso. El problema que se  presenta es que las señales creadas en no cambian su estado hay comunicacion entre el controlador y la interface de usuario en labview . Por ejemplo el pulsador de marcha no cambia su estado y por consiguiente el robot no recive el estado que deberia, para de false a true y activar  la rutina principal programado,me gustaria saber si alguien me podria dar una idea por que aunque se ven  las señales booleanas, estan estas no cambia.


He configurado el ABB OPC configuration como el servidor y Opc como cliente en laview ( OPC server 2013).


Agradeceria me ayudaran.

 

Hi, Iam a student ofAutomation and Roboticscurrentlyconducted aprojectartificialvisionthatI made inLabVIEWandmodulesvisionandmotion, DSC,Visionassistantthe processis to identifytypes of fruitsand weaknessesand the actuatoris an armofABBIRB120withIRB5Compactcontroller, thecommunicationis by meansofOPC,Imadethe whole process.Theproblem that arisesis that the signalscreateddo not change theirstateno communicationbetween the controller andthe user interfacein LabVIEW.For examplethestart buttondoes not change itsstateand therefore therobotreceivesthe stateshould,forfrom false to trueand activate thescheduledmain routine,I wonder ifsomeone couldgivemean ideathatalthoughthey seeBooleanthesesignalsarenot changed.


I configuredtheABBOPCas the serverconfigurationas a customerand Optionslaview(OPCserver2013).


Iwould appreciatehelp.

Daqpad 6507 driver for Win7 64bit operation system

$
0
0
I encountered a problem recently with one old DI/O board- DAQPad 6507, which is a Traditional NI-DAQ (Legacy) device. I found no driver compatible with my Win 7 64bit operation system. According to NI online documents like
http://www.ni.com/product-documentation/8177/en/. even  NI DAQ 7.5 is only for Windows Vista/7  32-bit
 
Does NI have  any newly released compatible driver for this 6507 legacy board this year? Or any suggestions in solving this problem? Thanks so much!

How does one read digital inputs only when the inputs change?

$
0
0

I am using LabWindows/CVI 2010 with a USB-6343.  I have ten digital inputs connected to port 0 lines 12 - 21.  I would like to read these digital inputs when any of them have changed and notify a thread the inputs have changed.  I have been trying to use DAQmxCfgChangeDetectionTiming with a DAQmxRegisterSignalEvent that registers a change detection callback.  From the callback, I call DAQmxReadDigitalLines to read the inputs and then post a message to the thread.

 

I just want to read the inputs at the time of the change.  I have tried using FiniteSamps and ContSamps.  When I read the samples, the DAQmxReadDigitalLines often times out without acquiring all of the samples.  I have also tried DAQmxRegisterEveryNSamplesEvent, without the callback for the change detection event, but the every_n_samples callback doesn't seem to be called every time the inputs change.

 

Here is my code with error handling removed to shorten the post so it may not compile.  NUMBER_OF_INPUTS is 10 and NUMBER_OF_SAMPLES_PER_INPUT is 5.

 

DAQmxCreateTask("", &inputs_task_handle) == 0);
DAQmxCreateDIChan(inputs_task_handle, input_lines, input_names, DAQmx_Val_ChanPerLine);

for (i = 0U; i < NUMBER_OF_INPUTS); ++i) {

    DAQmxSetChanAttribute(inputs_task_handle, input_config_table[i].name, DAQmx_DI_InvertLines, 0);

    DAQmxSetDIDigFltrEnable(inputs_task_handle, input_config_table[i].name, FALSE);

    DAQmxSetDIDigFltrMinPulseWidth(inputs_task_handle, input_config_table[i].name, 0.00512);

    DAQmxSetDIDigFltrEnable(inputs_task_handle, input_config_table[i].name, TRUE);
}

DAQmxCfgChangeDetectionTiming(inputs_task_handle, input_lines, input_lines, DAQmx_Val_FiniteSamps, NUMBER_OF_SAMPLES_PER_INPUT);
DAQmxRegisterEveryNSamplesEvent(inputs_task_handle, DAQmx_Val_Acquired_Into_Buffer, NUMBER_OF_SAMPLES_PER_INPUT, 0, input_number_of_samples_callback, NULL) ;

//DAQmxRegisterSignalEvent(inputs_task_handle, DAQmx_Val_ChangeDetectionEvent, 0U, input_change_callback, NULL);

DAQmxSetRefTrigPretrigSamples(inputs_task_handle, NUMBER_OF_SAMPLES_PER_INPUT - 1);

DAQmxStartTask(inputs_task_handle);

bool Perform_Read_Of_BRU_Discrete_Inputs(uInt8 * const d) //lint !e960
{

    bool ret = true;
    int32 samples_per_chan_read;
    int32 bytes_per_sample;
    uInt32 available_samples;

 

    if (0 == inputs_task_handle) {
        ret = false;
    } else {
        (void) DAQmxGetReadAvailSampPerChan(inputs_task_handle, &available_samples);

 

        if (DAQmxReadDigitalLines(inputs_task_handle, NUMBER_OF_SAMPLES_PER_INPUT, 1.0, DAQmx_Val_GroupByScanNumber,
d, NUMBER_OF_SAMPLES_PER_INPUT * NUMBER_OF_INPUTS, &samples_per_chan_read, &bytes_per_sample, NULL) < 0) {
            ret = (samples_per_chan_read == NUMBER_OF_SAMPLES_PER_INPUT) ? true : false;
        }
    }

 

    return ret;
}

 

#if 0
static int32 CVICALLBACK input_change_callback(TaskHandle taskHandle, int32 signalID, void *callbackData) {
    uInt8 temp_digital_inputs[NUMBER_OF_SAMPLES_PER_INPUT][NUMBER_OF_INPUTS];

 

    if (Perform_Read_Of_BRU_Discrete_Inputs((uInt8 *) temp_digital_inputs)) {
        memcpy(digital_inputs, temp_digital_inputs[NUMBER_OF_SAMPLES_PER_INPUT - 1], NUMBER_OF_INPUTS);
        assert(BRU_Discrete_Input_Has_Changed());
    }

   

    return 0;
} //lint !e715 !e818
#endif

static int32 CVICALLBACK input_number_of_samples_callback(TaskHandle taskHandle, int32 event_type, uInt32 num_of_samples, void *callbackData) {
    uInt8 temp_digital_inputs[NUMBER_OF_SAMPLES_PER_INPUT][NUMBER_OF_INPUTS];

 

    if (Perform_Read_Of_BRU_Discrete_Inputs((uInt8 *) temp_digital_inputs)) {
        memcpy(digital_inputs, temp_digital_inputs[NUMBER_OF_SAMPLES_PER_INPUT - 1], NUMBER_OF_INPUTS);
        assert(BRU_Discrete_Input_Has_Changed());
    }

 

    return 0;
} //lint !e715 !e818

 

light intensity measurement using photodiode

$
0
0

hi,can anyone suggest code for digital image capture and saving from polarising microscope using labview2014

 

Drive 24V relays using 9476

$
0
0

Hello,

 

I am new to Labview and to Digital output module in general.

I would like to use an NI 9476 to actuate 24 V relays. My setup consists of a 24 V power supply feeding into the Vsup and COM channels and I have multiple relays connected to the terminal blocks and would like to pass control signals (continuous signal when on) to them.

I tried to use DAQ assitant passing the signal to the desired output, but I am getting the following error.

Non-buffered hardware-timed operations are not supported for this device and Channel Type. Error - 201025.

I read through knowledge base and reveiw the forum search results, but was not able to understand.

Can I still use DAQ assitant to control outputs on 9476 or do I need to write new codes for this?

It would be greatly appreciated if you could give me some guides to work on this. (Like simple VI to start with).

Thank you.

 

Jake

 


make USB-6001 digital output always high or low in C

$
0
0

Hello all,

 

I am new to the NI DAQ interface. I have an USB-6001 and I am trying to use this device to control some logic circuit in C. So what I want to do is:

 

* set some digital output lines to high or low levels, and change their status when needed (in C).

 

I have tested the device in NI MAX -> Test Panels, and found that the device is able to do this. Then I try to do it in C. I hace checked the examples, and the function I should use is the one called "DAQmxWriteDigitalU32". I have problem in understanding its input parameters. I have tried something with my own understanding, but it does not work as I expected. Here is one test I did:

 

uInt32   data=1;

int32 written;

TaskHandle taskHandle=0;

DAQmxErrChk (DAQmxCreateTask("",&taskHandle));
DAQmxErrChk (DAQmxCreateDOChan(taskHandle,"Dev1/port0/line7","",DAQmx_Val_ChanForAllLines));
DAQmxErrChk (DAQmxStartTask(taskHandle));
DAQmxErrChk (DAQmxWriteDigitalU32(taskHandle,1,1,10.0,DAQmx_Val_GroupByChannel,&data,&written,NULL));

taskHandle=0;
DAQmxErrChk (DAQmxCreateTask("",&taskHandle));
DAQmxErrChk (DAQmxCreateDOChan(taskHandle,"Dev1/port0/line0","",DAQmx_Val_ChanForAllLines));
DAQmxErrChk (DAQmxStartTask(taskHandle));
DAQmxErrChk (DAQmxWriteDigitalU32(taskHandle,1,1,10.0,DAQmx_Val_GroupByChannel,&data,&written,NULL));

 

I want to simply set "Dev1/port0/line7" and "Dev1/port0/line0" to high level, but only "Dev1/port0/line0" responds me. The second parameter of the function DAQmxWriteDigitalU32 corresponds to numSampsPerChan. If i replace it (currently 1) with a larger value, e.g. 100, I can see that "Dev1/port0/line7" sends a number of 1 out, then return back to 0. So I guess the problem is just that I do not understand well all parameters of the function DAQmxWriteDigitalU32. Can anyone please tell me how I can set a digital output line to 1 or 0? 

 

Thanks!

 

Hongkun

 

I need a file for EPLAN P8 Version 2.4

$
0
0

My problem is that I need a file for EPLAn P8 about NI USB-6501.

Led always on when I stop my loop

$
0
0

 Dear All,

Now I used NI-6008 when I used case structure to program via digital output. It 's can turn on and off. But when I tried to turn On and then push stop button to while loop.The Led that I connect to is still on when I stop my program. How can I turn off this led when I stop my program?

 

Thanks

Camera+Lens

$
0
0
Hello!
 
I'm looking for a camera with an appropriate lens which could give a full screen image of the distance between the anode and cathode, which varies between 1 micrometer - 1 millimeter (see the experimental setup attached). Minimal distance between the object and camera is about 55 mm. What would you recommend?
 
Thank you!

USB-6000 DIN-mount digital output isolator/relay modules

$
0
0

Does anyone know of a good isolated digital output module that's compatible with the USB-6000, USB-6001, USB-6002, and USB-6003 series cards?

 

I have been trying to install these in some industrial machinery designs, and they don't just play nicely with the 24V DC, 4-20mA, and 120V AC signals that are common in these scenarios.  I have been using Grayhill, Phoenix Contact, and Crydom optoisolated digital IO modules (for example: http://www.grayhill.com/assets/1/7/IO-Intro.pdf) with the X-series cards with good results in these applications, but the X-series cards provide 5V I/O at 16 or 24 mA, with up to +/- 20V protection circuits.  I can't find any isolators that work with the USB-6002's measly 4mA and 3.3V. Even the modules that say 3V only work with at least 10 mA, because they need to light an indicator LED AND the optoisolator!  And when 10mA at 3.3V is provided, the output current is insufficient to drive many higher-current solenoids and so on.

 

I can use a logic-level FET like a FQP30N06L or a transistor array like a ULN2003A, but these are all PCB-level components and should have extra protection diodes and resistors, and need a PCB mount point (which could be the 779511-01 NI USB-6000 Series Prototyping Accessory, at a very reasonable $37), and they require the wiring team (who are used to using LOTS of screw and crimp terminals) to break out the soldering irons, which they don't like to do. Also, if they need replacement - because the electrically noisy systems present inside some of these machines WILL destroy an un-protected MOSFET - it's not going to be acceptable to ship one of those while it might be OK to ship something that can be installed with a screwdriver.

 
 Has anyone found a digital isolation option that (1) mounts on DIN rail or a panel, (2) drives an amp or more at 24V with 3.3V at 4 mA input, and (3) is rugged enough to survive an industrial machine environment?

Is it save to use digital output as a digital input signal for another channel

$
0
0

Hi all,

 

I know this is a stupid question, but I do not have other signal generator by hand. So what I want to know is, can I use the digital output signal of my USB-6001 as an input signal for the same device but on other digital port? I did not try out directly because I do not want to burn the device down......

 

Thanks

Simple Project with Myrio

$
0
0

Hi,

For my homework, I need to be do it project with myrio device. Until now, I saw servo motor, 7 segment led, accelerometer, gyroscope, h bridge geared motor.

Related with this products I need to make a simple project. But, I have no idea what should I do . Please if you kow some simple basic projects can you tell me?


read multiple analog inputs at the same time

$
0
0

Hello all,

 

I am using USB-6001 and want to develop a multiple task app in C++. I am trying to read multiple analog inputs at the same time, but get some errors. To make it simple, I copy one of the example code to read in analog data in one channel then turn it into a function. Then I call this function in thread with different pin names (such as Dev1/ai0, Dev1/ai1) and I come cross this error:

 

"The specified source is reserved. The operation could not be complete as specified"  status code -50103

 

I search the forums, this may because I use hardware timing in this function, and this hardware timing cannot be use at the same time by several tasks. I may have to put all lines I want to read in one single task (such as Dev1/ai0:1). In this way I can read two lines at the same time. However, when I try this, I meet other error:

 

"buffer is too small to fit read data" status code -200299

 

So, here is my question, what should I do if I do want to read multiple analog inputs at the same time? Is the thing that hard timing cannot be use by multiple tasks true? If I have to read multiple lines at a single task, how do I set the parameters?

How to output custom TTL pulses for stepper velocity control

$
0
0

Hi,

I need to control the velocity of a stepper motor by using ttl pulses. 

 

I have cDAQ9174 and NI 9401 connected to labview in my windows PC

 

I need to create upto 1000 ttl pulses per second and repeat it in a loop.

I would create an array of ones and zeroes which are to be translated into +5v and 0v respectively.  I need a code to translate this array to ttl pulses.

 

I am new to labview so I have no idea where to start. If you have any solutions or suggestions, I'd be extremely thankful. Also, please direct me to the helpful resources.

 

Thanks

Overshoot, undershoot, ringing, and crosstalk on digital output channels

$
0
0

I'm using a USB-6363 interface with two SCB-68 terminal boxes. Each box is connected using a 2-meter SHC68-68-EPM cable to the 6363.

 

I am using Port 0 to generate digital waveforms using an 8 MHz clock. The FIFO buffer appears to be able to handle the data rate, but the quality of the digital signals at the terminal boxes is an issue. Specifically there are overshoot, undershoot, ringing, and crosstalk between channels. This is causing false triggering on the device under test. See attached scope plot. The measurements were made directly at the terminal box without the DUT connected. The yellow trace is on P0.0, and the green trace is P0.3. The crosstalk is reduced on channels located on the other connector, but it is still there. I am using 20 digital outputs from the 6363, so I can only sepatarate certain groups of signals to each terminal box.

 

The device I am testing nominally runs at 1V Vdd, so I am using NXP NVT20xx series level shifters to bring the logic-high levels from 5V down to 1V. These level shifters clamp any high voltages to about Vdd + 0.25V, but anything lower gets passed through almost verbatim. This means that any extraneous signals centered around logic-low are problematic because it only takes a few 100 mV to cause false triggering on the DUT.

 

It is my suspicion that the 2m length of the cables is the main cause of my problems. I know that this same cable is available in 0.5m lengths. I have told my supervisor/professor that we may have to order shorter cables, but I want to see if it’s possible to mitigate the issues with additional circuitry before purchasing.

 

I have searched through knowledgebase articles and forum posts, but most of what I found concern matching impedances on devices designed for 50 ohm loads. It is my understanding that the 6363 is not designed for matched networks, but is there a recommended termination or filter circuit that can significantly reduce the unwanted anomalies? Ideally I’d like to avoid sacrificing rise/fall times too much. Also attenuation of the signals needs to be minimized since there are times that the Vdd will be at 3V, i.e. the logic-high input signals need to be at or above Vdd in order for the level shifters to work properly.

 

I have tried adding load resistance (min. 220 ohms to limit current to less than 24mA), and this significantly reduces the ringing. However, it might be problematic dealing with the ground return paths for that much current on 20 channels. I have also tried RC low-pass filtering, but sufficiently reducing the ringing leads to long rise/fall times.

 

If it turns out that ordering shorter cables is a better solution, will the 0.5m cables be short enough to reduce the anomalies sufficiently? Will I still need termination/filtering on each channel?

PCIe-6321 DI change detection

$
0
0

Hello,

 

This is my first project with DAQ so sorry for simple questions.

 

I have some switches like emergency stop, start, pause... that interface with my program and I want to preform some actions when value change is made.

 

If I uderstand correctly in my card I have 8 DIO lines that support buffering so they can be used for change detection (PFI lines can't), so I plan that this lines will be my inputs. PFI lines will be used as outputs to switch some relays because I don't need to monitor them.

 

change detection.png

 

So this concept should make it work?, whenever some of my lines at port 0 changes I read new data on all lines at port 0  and I can preform some actions based on which line chaged.

My question is how do I determine which button is switched after I start my application. How can I get initial values before first change happens?

 

Please correct me If I am thinking wrong Smiley Happy

Digital Output reading in LABVIEW

$
0
0

Hi,

im using modbus fundumentals example in order to read and write into delta plc registers ( by using a matching ladder diagram)

i have succeeded to read input values from its register .

i would like to know how i could read digital output values.

 

thanks

Viewing all 2182 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>