11-04-2010 08:48 AM
According the the Help, you can add Shift Registers to Structures. The Stacked Sequence is a Structure, but I don't see the option to add a Shift Register when I right click on the left side of the Structure. Am I missing something? I want to run my Error In and Error Out lines through the Shift Registers in a Stacked Sequence so as not to have to do it using a Feedback Loop, as that would get messy.
Solved! Go to Solution.
11-04-2010 09:02 AM - edited 11-04-2010 09:05 AM
According the the Help, you can add Shift Registers to Structures. The Stacked Sequence is a Structure, but I don't see the option to add a Shift Register when I right click on the left side of the Structure. Am I missing something? I want to run my Error In and Error Out lines through the Shift Registers in a Stacked Sequence so as not to have to do it using a Feedback Loop, as that would get messy.
Hi,
"According the the Help" ? Where did you see that ? Shift registers are only available with loops.
You can only add sequence locals to stacked structure which will allow you to transfer data between each case. But please, don't use stacked structure...This is hideous...
Regards,
11-04-2010 09:15 AM - edited 11-04-2010 09:15 AM
Are you perhaps getting confused with stacked shift registers? These allow you to access the values from iterations earlier than the previous one.
But you still can't put them on sequence frames. ![]()
11-04-2010 09:22 AM
Agreed you can't put SRs on SS, but what you CAN do is...
A stacked sequence is just an inflexible straight line State Diagram (search on State Diagram, there are plenty of examples and KB articles). State Diagrams are implemented using a While Loop where SRs are available.
SO convert to State Machine and continue as you had envisioned.
Ben
11-04-2010 11:47 AM
I guess my issue is grasping the concept of State Machines.I do stand corrected, on the fact that you can only add them to Loops. I quickly saw "structures" and skipped past the fine details.
As I like to use the Error In/Out lines to control program flow, I still can not conceptualize how I do this through a Stacked Sequence. The reason I'm not using Flat Sequences structures, as this would elimnate the issue of "feeding back" in to the next Error In (coming from an Error Out - as I'm using these to see if an instrument command errors) in the sequence frame I'm sending or rceieving another set of commands to the instrument.
11-04-2010 11:57 AM
I think what you want is the "Add Sequence Local" function which allows you to pass data from one frame to the next. It's an ugly, confusing choice when you have much better options though.
It sounds to me like you just need to create some subVIs to better compartmentalize your code.
11-04-2010 12:31 PM - edited 11-04-2010 12:33 PM
@NIquist wrote:
I think what you want is the "Add Sequence Local" function which allows you to pass data from one frame to the next. It's an ugly, confusing choice when you have much better options though.
It sounds to me like you just need to create some subVIs to better compartmentalize your code.
I do understand your comment about compartmentalizing, but if I did that I'd have a VI for every few event sequences. The only reason I'm putting them in a stacked sequence, is to allow whom every might want to understand the flow, not to have scroll across. If I was working in a coding language, this would be a simple series of commands, in maybe 10 lines of code. But that's where I'm struggling to see some of the advantages of LV. I simply want to have errors flow forward, and send a series of commands to the same instrument with some delay in some cases.
11-04-2010 12:50 PM
As been mentioned by other posters, you should use a state machine for this. You can still get the same functionality, but with well named state frames it is easy to click on the selector label and go directly to the desired frame. With a stacked sequence you have to know which number the desired frame is. This is only one of the MANY advantages of the SM over the SS.
11-04-2010 12:54 PM
@Newenglandguy_LV wrote:
@NIquist wrote:
I think what you want is the "Add Sequence Local" function which allows you to pass data from one frame to the next. It's an ugly, confusing choice when you have much better options though.
It sounds to me like you just need to create some subVIs to better compartmentalize your code.
I do understand your comment about compartmentalizing, but if I did that I'd have a VI for every few event sequences. The only reason I'm putting them in a stacked sequence, is to allow whom every might want to understand the flow, not to have scroll across. If I was working in a coding language, this would be a simple series of commands, in maybe 10 lines of code. But that's where I'm struggling to see some of the advantages of LV. I simply want to have errors flow forward, and send a series of commands to the same instrument with some delay in some cases.
Perhaps it would be easier to help you understand if you posted the code you have so far. Are you using the sequence frame because you are using the Wait function, which has no error in/out terminals? If so, you can easily whip up a wrapper VI for that function.
11-04-2010 01:00 PM - edited 11-04-2010 01:00 PM
@smercurio_fc wrote:
Perhaps it would be easier to help you understand if you posted the code you have so far. Are you using the sequence frame because you are using the Wait function, which has no error in/out terminals? If so, you can easily whip up a wrapper VI for that function.
I have never understood why NI hasn't done that. I'll bet 99% of experienced developers have that VI stashed for quick access. Not to mention OpenG. ![]()