hi, I have some gabs to get the actual time and the varible changed as
the program running, as the attachment shown I would like to have the
variable actual time when I run the program; A and B as well.
there are several vi's in the time&dialog palette that give you an actual values for the time. Just grab an appropriate one... Most of those functions give you an absolute time value with zero somewhere around 1. Jan. 1902. So you have to take the actual time at starting your program and subtract that value each time you ask for a new value. SO you get the relative time (regarding the start of your program).
Best regards, GerdW
using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
the straight forward solution is to use a case structure for each
decision point and a subVi (for having better overview) for each task
(rectangular boxes).
But this can lead to programs hard to maintain, when there is a change in the flow chart...
Best regards, GerdW
using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
As the attachment shown, I could just make the first circle fulfill Tactual <=Ttast + Tstart, however, I could not change this Tstart to the last Tactual, that is to say, since Tstart should changes as the program runs, it should be variable......the problem is I could make it.....
whenever you need a 'variable' you can use a wire in LV...
I made some changes to your vi, maybe it shows you the concept. I tried
to follow your flow chart, but it isn't as easy as it's not really
clear to me how to handle the different constants (A, B, T_actual,
T_total...).
Best regards, GerdW
using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
in addition to my last post:
You say T_start should change in the program run, but your flow chart
shows it different. Here T_start is set just once in the beginning...
So you better carefully draw your flow chart 🙂
Best regards, GerdW
using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
try to minimize the use of local variables. Use wires when possible!
This way you don't break the dataflow and get no race conditions.
See changed example.
Best regards, GerdW
using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019