01-15-2025 06:37 AM
So for my project, i need to loop this part for 10 repetitions and there is a local variable elsewhere in the block diagram that captures the value of timestamp in to run different function. I want to make a format that the timestamp in is captured 10 times and i expect 10 timestamps to be sent to the local variable but when i run, i find that only the 10th timestamp is sent. I am very new to Labview, could someone help me out.
01-15-2025 07:01 AM
You update the P1 timestamp 10 times, but i suspect the following code executes afterwards and reads the last updated value. If you want to "send" the value, send it to a queue and have a 2nd loop react to it. See the Help - > Find Examples and search for Simple Queue example.
01-15-2025 08:27 AM
Hi Theeva,
@Theeva wrote:
i need to loop this part for 10 repetitions and there is a local variable elsewhere in the block diagram that captures the value of timestamp in to run different function.
So you should have learned from your example: Don't use locals to transfer data when it comes to "transfer all data in correct order"!
01-15-2025 01:59 PM
Local variables have nothing to do with "sending". They simply contain the value of their terminal transfer buffer. "What" you read from it depends on "when".
You need to start with some basic tutorials.
Can you take a step back and show the rest of the code? If you just want all the timestamps in their order as an array, you could autoindex at the loop boundary.
Please show us the entire program so we can get more specific recommendations! For example your globally initialize feedback node only makes some sense if there are outer loops. Also note that you have a problem with representations.
01-16-2025 01:13 AM
01-16-2025 01:56 AM
01-16-2025 02:26 AM
01-16-2025 10:15 AM - edited 01-16-2025 10:16 AM
@Theeva wrote:
(a pile of code fragment pictures)
Pictures of code fragments are useless for troubleshooting.. We cannot see what's in the other cases and what's outside the visible area or the overall architecture. We cannot tell what happens when and in what order.
In this case there is serious "code smell" and we can tell that you need to start with some basic tutorials, then implement a good architecture (state machine?). I am sure that 95%-100% of your local variables are unnecessary. Make sure that array diagram constants show the first invalid element or a scrollbar so their size is obvious. For example your "temperature" string array could just be a scalar, right?