01-24-2025 02:59 AM
Hi alhabeeb,
@alhabeeb wrote:
I'm thinking to create an increment by 1 then multiply by the elapsed time. So each true case the counter increased by 1. For example the elapsed time is 5 (s). First ture case the total time is 1*5, the second true case 2*5, the third true case 3*5,... so on. I did it as shown in the pic. but I had an error.
You created a "data cycle": you send data (string) into the case structure, but that string depends on data ("Data No.") from inside the case structure…
Why don't you use the wire before the loop?
01-24-2025 08:33 AM - edited 01-24-2025 09:06 AM
Sorry not really understood your suggestion?
01-24-2025 10:21 AM - edited 01-24-2025 11:00 AM
@alhabeeb wrote:
It is OK now. First time 0 (s) , counter*second elapsed time. If there is any suggestion please let me know.
No, this is very convoluted and will cause accuracy problems! Why not attach your VI instead of showing us multiple pictures? Also, since your lower shift register is not initialized, it will only work correctly on the first run of a session, but contain stale data from a previous run later.
01-24-2025 10:56 AM
@alhabeeb wrote:
Sorry not really understood your suggestion?
It wasn't a suggestion, but an explanation!
You have a circular data dependency that is incompatible with the dataflow. The multiplication at "A" depends on data from the case structure, but the case structure depends on data from the array (B). Catch 22!
If you want the total elapsed time, here is one possibility. (since you seem to prefer pictures over VIs, I am showing pictures 😄 )
01-27-2025 02:50 AM - edited 01-27-2025 03:17 AM
Hi,
Sorry for the inconvenience. This is my VIs. It is good.
Thanks
01-27-2025 11:01 AM - edited 01-27-2025 11:06 AM
@alhabeeb wrote:Sorry for the inconvenience. This is my VIs. It is good.
Well, does it work correctly? I don't think so!
No, you still have problems.
Here's how it could look like cleaned up a bit...
01-28-2025 11:12 AM
@altenbach a écrit :
- Decide if you really need to "convert EOL" when saving text. I usually don't?
Thanks a lot but I didn't understand this phrase.
01-28-2025 11:35 AM
01-28-2025 01:02 PM
@altenbach wrote:
To expand a bit on this, this property is platform dependent. In Windows, it will replace the value for LF with the values for CTRL+LF. If the file is binary in format, this will be disastrous because it will add an extra byte to your data for every occurrence of the ASCII value for LF. Turn it off if you're reading/writing binary data.
01-29-2025 03:01 AM
Thanks for the explanation.