06-29-2018 06:01 PM
Hello,
I'm not seeing expected behavior using a shift register in a while loop. I'm initializing the register (which contains a cluster from a type def), using bundle by name to update a field from a user input, and two others from a constant, and then passing the value out to a shift register. The next loop sends in the elements unchanged. I expected to see the changed values on the next loop but the probe shows that it's empty coming out of the left shift register.
I can post the code if needed, but hoping my mistake is obvious from the picture.
Solved! Go to Solution.
06-29-2018 06:18 PM - edited 06-29-2018 06:19 PM
@EnterUserName wrote:
... but hoping my mistake is obvious from the picture.
No, we cannot see the the other cases. (Big case structure, event structure, etc.). Pictures are useless for debugging.
What is the next loop? (I only see one loop). If you mean next iteration, which state is executed in the next? If it remains at idle after 200ms, it will rewrite the cluster again from the same controls and diagram constants.
Where do you place the probe?
06-29-2018 06:21 PM
It is not obvious from the picture, please upload for LV 2016 or earlier.
06-29-2018 06:42 PM - edited 06-29-2018 06:55 PM
Thanks for the quick reply. I've attached the .ctl and the vi (though without some of the subVIs). It is meant to simply sit in idle until an input from the user is seen and then a Program button appears and sits in idle again until the Program value change event happens.
The problem has been that the constants and the user input string works in the case structure, but it doesn't appear on the next loop from the shift register.
I place the probe after the bundle by name (looks fine), and after the shift register on the left side between the while and the big case.
The desired result would be that the constants continue to rewrite, and the string control continues to rewrite.
Edit: the desired result actually works, it's when I hit Program - the cluster that is passed into the programming case no longer has the values from the control or the diagram constants.
06-29-2018 08:50 PM - edited 06-29-2018 08:54 PM
Your shift register is wired across behind the case structure and never receives any new data. All the various cases do is send the new data to a tunnel that is not connected on the outside.
If I move the tunnel down, here's what it looks like.
Delete the wire going into the shift register on the right and then wire from the tunnel to the shift register.
07-02-2018 10:52 AM
And I thought I had even checked that.
Thanks altenbach!
07-02-2018 02:15 PM
Also make it a habit to uncheck the "Use Default Values if Unwired" on your case structure output tunnels. Even better, select the Linked Input Tunnel --> Create and Wire Unwired Cases. This will eliminate many a heartache caused by wondering why you have default values on your shift register caused by an unwired output tunnel having default values.