From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

looking for a way to generate experiment sequences

Hi,

 

I'm trying to figure out a way to use labview and NI USB-6211 to generate and control the output pulses and data taking in well timed sequences. The goal is that I can input a table of parameters in the front panel and the DAQ can generate the corresponding sequences (a simple illustration attached(sorry about the bad drawing)). I would like to have a precision on the level of milliseconds between shots and microseconds within shots, for now, and I might use some external timing source in the future.

Screenshot (5).png

I tried the stacked sequence, using a counter channel as the main output, and other channels triggered off it to ensure precise timing. The VI is attached, the file name is mainsequencebettersync.vi.

The problem with such method are: 

1. the timing between shots are not very precise.

2. I have resources conflict problem when either multiple analog output channel, or multiple analog input channel are active within a shot (error 89137 and 50103). 

3. if I want more shots (frames in the stacked sequences) with different configuration, I have to create then in the block diagram and reconfigure all the front panel controls. In the future, there might be tens or even hundreds of shots, so it will get out of hand real quick. Not to mention I will need to modify the number of shots and the configurations within quite frequently. 

 

So here's my question: is it possible to achieve the goal I described above with the software-hardware combo I have? If so, can you tell me how to do it? If not, can you recommend some hardware and software that can achieve my goal?

 

Thank you in advance

0 Kudos
Message 1 of 7
(2,168 Views)

I know you tried to explain what you were trying to do (thank you for that), but I'm sorry to say that I just don't "get it".  Perhaps you could "say in words" the idea behind a single "shot" (an elusive concept, to me).

 

Here's what I think may be happening:

  • You want to deliver a TTL Pulse using a Counter Channel where you control the delay until the Pulse goes high and the duration of the Pulse (until it goes low).
  • You want to sample (at some unspecified Sampling Rate) from an Analog Input Channel.  You want the start time of the A/D to be variable and you want the Sampling Time to be specified (equivalent to saying you want a specified number of samples, since # Samples = Sampling Rate x Sampling Time).
  • You want a delay (from what?) before doing something else.

I'm not as familiar with the USB-6211, but have used the USB-6212, which has two Counter/Timer channels which could be used to handle the Counter Out and Analog In timing tasks, but I'm not so sure how you would handle the between-"Shot" delay, particularly if you want hardware precision.  If you don't mind using the LabVIEW Wait(ms) function for the delay, that could work, I suppose ...

 

In any case, you do not (ever, well, hardly-ever) use a Sequence Structure!  You want a State Machine, maybe one with the various "Shot Parameter" in an Array and a For Loop running through the Array saying to the State Machine "Do Shot N" -- if you want to repeat the N shots "until I say Stop", you could wrap this in a While Loop with a Stop Control ...  Think (and write down) what you want to do, then design it.

 

Bob Schor

0 Kudos
Message 2 of 7
(2,135 Views)

Thank you for the reply. "Shot" just means a group of actions. Say, two channels send out two pulses within the time frame. I want the relative timing within this time frame to be very precise, while the timing between shots (that's the "wait") in the table can be less precise. "initial delay" is from the start of the "shot".

 

Anyway, I will check out the state machine. It looks promising, Thanks.

0 Kudos
Message 3 of 7
(2,105 Views)

Hi,

 

did you finally solved your problem?

I have almost the same questions...

Bests

Sébastien

0 Kudos
Message 4 of 7
(1,842 Views)

@MAILFERTSeb wrote:

did you finally solved your problem?

I have almost the same questions...


Then you might want to follow the same "path" at working to find your solution.

 

Bob Schor

0 Kudos
Message 5 of 7
(1,814 Views)

You are a clever and smart guy… Thank you.

0 Kudos
Message 6 of 7
(1,802 Views)

Hi CIML,

 

please stick with your own thread! No need to ask the same (atleast) twice in several threads…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 7 of 7
(1,798 Views)