Jump to content

Software Trigger with Case Structure and Signal Value Input


Recommended Posts

Posted

Hi

I want to create a logic to trigger an event with Case Structure block with Greater Than block, where the "x" value for the Greater Than is input coming from one of the channels value.

I used Get Waveform Components to extract the "Y" value from waveform and wanted to use this as an input into the "x" for Greater thank block, however Case Structure does not accept this type.

Any thoughts?

 

Posted

You are trying to wire an array to the case selector. Extract the maximum value from the Y array using Array Max & Min. You might also want to take the absolute value of the Y array.

Posted

That is just the first value of the Y array, not its maximum.

I assume you want to start the Hi_Rate_Trig task after reaching the threshold, right? Your VI won't do that, because the case structure executes once at the start when the boolean is still false. Get rid of the local variables and use data flow instead.

Some more points:

  • either wire a number of samples to read or a duration to the DAQmx Read VIs. That makes your waveforms the same length which makes postprocessing easier. Check what works with your resampling duration
  • For continuous sampling mode, it is usually not necessary to wire the samples per channel terminal.
  • labels keep the block diagram and front panel readable

See if the attached VI does what you want.


 

R_R_9_MTDS_Split_Rec_trig_CM.vi

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.