09-07-2016 03:29 AM - edited 09-07-2016 03:32 AM
Hello,
I am building a tool based on state machine approcah as shown below:
Basically, this tool get access to a hardware device via its DLL file and send read request based on a predefined parameter values (parameters list), the recieved values are displayed on a table (output table).
The process is repeated for ever until user stop it.
in the mean time a log file is created and the results are saved on Excel file as shown below
Problem: the problem is, the timestamp is not saved in the excel file and this is because the timestamp is populated for short time on Output Table as shown below.
In the below picture, you can see that output values are written and displayed on Output Table, but timestamp is displayed for short time (I can see this during Highlight Exceution mode) and when a new output value is written the previous timestamp will disappear!
I can not find the reason of such behaviour, I want the timestamps and output values to stay displayed on the Output Table.
any advise?
I attached the complete project for your reference but is wont work without the hardware.
Best Regards
Hakam
Note: I am using Labview 2016
Solved! Go to Solution.
09-07-2016 03:34 AM - edited 09-07-2016 03:35 AM
09-07-2016
03:38 AM
- last edited on
04-28-2025
01:30 PM
by
Content Cleaner
Are you using Replace Array Subset Function: https://www.ni.com/docs/en-US/bundle/labview-api-ref/page/functions/replace-array-subset.html it simply replaces the previous value.
Edit: Ignore this message.
09-07-2016 03:39 AM
Hello GerdW
Actually this is my first project in Labview.
I am using shift register for the state machine and also for passing setting parameters but I can not imagine how can I use shift register for my Output Table. Both timestamp and output value are written inside the same loop.
09-07-2016
03:41 AM
- last edited on
04-28-2025
01:31 PM
by
Content Cleaner
Passing Data Between Loop Iterations in LabVIEW: https://www.ni.com/docs/en-US/bundle/labview/page/shift-registers-passing-values-between-loop-iterat...
09-07-2016
04:13 AM
- last edited on
04-28-2025
01:31 PM
by
Content Cleaner
Edit to my previous post:
You can also resize the Replace Array Subset Function and pass multiple values at the same time instead of two times. https://www.ni.com/docs/en-US/bundle/labview-api-ref/page/functions/replace-array-subset.html
09-07-2016 04:27 AM
Hi udka,
I can not figure out how to use shift register for my Output Table
Local variable seems working fine netween states, but inside state "Read cito" I am facing the problem. How can I use shift register inside the loop itself?
09-07-2016
04:36 AM
- last edited on
04-28-2025
01:32 PM
by
Content Cleaner
Disclaimer: Local and global variables are advanced LabVIEW concepts. They are inherently not part of the LabVIEW dataflow execution model. Block diagrams can become difficult to read when you use local and global variables, so you should use them carefully. Misusing local and global variables, such as using them instead of a connector pane or using them to access values in each frame of a sequence structure, can lead to unexpected behavior in VIs. Overusing local and global variables, such as using them to avoid long wires across the block diagram or using them instead of data flow, slows performance. Source: https://www.ni.com/docs/en-US/bundle/labview/page/using-local-and-global-variables-carefully.html
-Coming to your problem Read : https://learn.ni.com/learn/article/labview-tutorial and https://learn.ni.com to learn how to use local variable and Shift register.
-Did you follow by expanding the replace array instead of two times?
09-07-2016 04:36 AM
You solved it!
resizing the Replace Array Subset Function solved the problem
The log file is somehow not correct, it should be easy to correct it
Thank you udka
09-07-2016 05:31 AM - edited 09-07-2016 05:33 AM
Hi hbs,
you solved the race conditon (mentioned above) by deleting the parallel access to the very same local variables - but you should still use a shift register to hold your "output table" data!
What's the point of having a stop condition in your FOR loop, but not use it?