04-22-2024 12:57 AM
I tried to use a part of the code for Wait functionality from an example code using .NET, but when I tried to use it, the delay did not work.
The code (C:\Users\Public\Documents\National Instruments\TestStand 2020 (64-bit)\Examples\NI_SemiconductorModule\Accelerometer):
private static void Wait(double timeInSeconds)
{
// Thread.Sleep() has a resolution over 10ms, so use Stopwatch to support shorter settling times.
if (timeInSeconds > 0.0)
{
Stopwatch stopwatch = Stopwatch.StartNew();
double frequency = Stopwatch.Frequency;
while (true)
{
double elapsedSeconds = stopwatch.ElapsedTicks / frequency;
if (elapsedSeconds < timeInSeconds)
{
break;
}
}
}
}
I hope you can help me. Thank youuu
04-22-2024 03:38 AM
This seems TestStand related but you are posting in the LabVIEW forum. Not sure how active the TestStand forum is nowadays, but you likely won't get any more reactions here.
04-22-2024 03:46 AM
04-22-2024 07:28 PM
For example, I tried to put a delay of 2 seconds before the measurement using an Pxie-4139 and two seconds delay before displaying the measured value, but when I run the program, it happened so fast as if there are no delays.
04-23-2024 04:16 AM - edited 04-23-2024 04:17 AM
Hi dog,
@theblackdog wrote:
I tried to put a delay of 2 seconds before the measurement using an Pxie-4139 and two seconds delay before displaying the measured value, but when I run the program, it happened so fast as if there are no delays.
When I place wait steps then they (most often) do what I expect them to do:
The LimitTests show the elapsed time since "Statement" expression…