04-22-2015 09:59 AM
looking at the picture attachment. here is my question
this is in a producer loop for continuous sampling , i want this to do: if x (samples local variable) is less than or equal to 32768 (no. of samples) then continuous sample at 32768
just asking as theres a boolean output to this and wondering?
Thanks in advance
04-22-2015 10:24 AM
I'm having a hard time with the English here. You may find it easier to post in your native language. There are other language boards on the forums. That being said you'll need a case structure to take the boolean output and do something if it is true, or do something else if the boolean is false.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
04-22-2015 10:38 AM
this is my native language lol.
so i want to do a continuous sample, for no. of samples there is 4k,8k,16k,32k,64k.....etc
when i do a continuous sample, i want it so that it when no. of samples chosen is below 32,768 . ie the 4,8 & 16k number of samples, then it will automatically continuously sample at 32,768
if that helps?
04-22-2015 10:45 AM
So sorry about the language thing.
Like I said you can use the case structure. Wire the boolean output to the selector, and then if it is than 32768 have it return a constant of 32768, otherwise pass out the value.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
04-22-2015 01:56 PM - edited 04-22-2015 02:35 PM

You need to be really careful here because of race conditions.You are reading from a local variable of a control and in parallel you are writing to a value property of the same control. The outcome will strongly depend on the order of operations, but there is no way to predict what happens first. The result of this code cannot be predicted.
If this is a control operated by the user, you can set the data entry limits so values lower than a defined limit cannot be entered. No code needed! You can also disable&grey out certain enum values.
Otherwise you could just use min&max function to force a lower limit (assuming the enum values are sorted).

04-23-2015 05:18 AM
hi altenbach
so i have 2 controls for 'sample' & 'continuous sample', then i have no. of samples, 4k,8k,16k,32k etc....
i want to keep 4,8 & 16k no.of samples for the 'sample' control, but in the continuous when 4,8 & 16k are chosen it will automatically put out 32k samples, if that makes sense?
hence i cannot do the disabling of enums and greying them out, as both 'sample' & 'continuous sample' share the same control 'no.of samples'
04-23-2015 06:27 AM
So then you just put a case structure around the code Altenbach gave you so that the comparison is only done when in continuous mode.