Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Synchronizing digital input port1 with another signal(multithreading) using pxie6366 Daq card

Hi all,

 

I am using pxie6366 DAQ module for acquiring digital data on port1. My application is that I need to capture the data from several signals inside the chip when my chip goes from active to standby mode. For this I am using multi threading, one thread for data acquisition and another thread for making the mode transition( say standby_enable() command.). The problem is I am using port1 which doesn't support buffered acquisitions and so I am not able to synchronize these two threads. I am using I2C for communicating with the chip.

I need the data acquisition to be running during the chip transition.

Could someone suggest a solution for synchronizing the two threads so that I can capture the data exactly.

I am using python for this application. Attached is a small portion of my code

 

thanks 

Roshan

0 Kudos
Message 1 of 3
(3,687 Views)

Hi Roshan,

at first I want to tell you that I am no familiar with python.

But I have an idea.
Why you not first start the acquisition threat and after that the threat for switching the state?
After acquisitioning the data you can cut of the first values until the start of the switching process.
If necessary you can log the port1 with another digital input for getting the start of the switching process.

Regards
Robert

0 Kudos
Message 2 of 3
(3,653 Views)

Roshan,

 

I think what I said on the other thread has you confused about "buffered acqusitions" on Port 1. You cannot do timed Digital Input / Output from port 1 using the digital timebases (DI and DO Timebases), however Port 1 gives you access to the counters on the X-Series card that you have, so you could perform buffered acquisitions of two edge separation that you want. Let me break down your problem into a couple of sections:

 

Buffered Acquisition / Measurement of your Two Edge Signal:

There is an example on the NI Community, it's in LabVIEW, but if you look at the "Block Diagram Steps" they have a step by step walk through of the functions that LabVIEW calls to perform the action. You can find the same function calls for Python and be in luck. This example will take a continuous amount of two edge measurements until you stop the acquisition. There are also examples for Finite Buffered Two Edge Measurements and Single Two Edge Measurement.

 

Continuous Buffered Measurement of Two Edge Separation with DAQmx
https://decibel.ni.com/content/docs/DOC-11418

 

Triggering your Counter Task:

You will need to use an Arm Start Trigger. Counter input operations use this arm start trigger to give you the same functionality as you would expect with a Start Trigger. There are three properties you will have to call, I don't have the python wrapper, but I'm assuming the function calls are similar to the C calls.

 

DAQmxSetArmStartTrigType

DAQmxSetDigEdgeArmStartTrigSrc - (Source)

DAQmxSetDigEdgeArmStartTrigEdge - (Rising or Falling)

 

Other things:

I am not sure if you want to trigger your two edge separation measurement and get a single measurement or if you want to take multiple measurements from a single trigger. The example I pointed you to above is multiple measurements for a single trigger (once you add the Arm Start Trigger). If you want to do a single Two Edge Separation measurement from a single trigger, then you will need to look at the example on Two Edge Separation with DAQmx that I think I pointed out earlier. You can also reference the section in the X-Series User Manual that talks about Two Edge Separation Measurements. You can add the arm start to any of the examples I showed to get the trigger functionality that you want.

 

As for how you want to trigger the two edge measurement, it really depends on what signals your chip is sending you. If you have a signal from your chip that goes high or low when your chip goes into active or standby mode, then you could wire that signal to the input for your arm start trigger and select the appropiate edge (rising or falling) to start your two edge measurement.

 

I hope this helps, just look over the examples and remember that whichever one you need, you will still need to add the Arm Start properties to it to get the trigger functionality.

 

Aaron W.
National Instruments
CLA, CTA and CPI
0 Kudos
Message 3 of 3
(3,645 Views)