LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

What does "mark as probe sampling source" do?

I noticed a while loop used the State Machine project had a right click option "mark as probe sampling source" so I clicke dit and it brought up a proble watch window and then I ran the example.

 

What is that thing supposed to do and when would I use that option?

 

I imagine I could find the answer myself but while I a searching, does any one know?

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 1 of 6
(2,922 Views)

Ben:

 

Here is link to the Help (not that I read or understand it):

 

http://zone.ni.com/reference/en-XX/help/371599J-01/lvfpgahelp/using_sampling_probe/

 

-AK2DM

 

~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
Message 2 of 6
(2,886 Views)

Thank you AK2DM !

 

I could have used that two days ago... sorta.

 

I was trying to enhance  VI that was a State Machine that did not have a flow diagram to go with it and the transision were let's say "convoluted" where the next state depended on something that happened about 5 states ago.

 

I resorted to watching in light-bulb mode and end up with 3 pages of hand written notes documenting the states.

 

Reading the help you found it seems the first step is to mark the loop as a probe sampling source.

 

Then go to the enum wire feeding the SR on the right side of the structure and right-click and choose Sampling Probe >>> While Loop.

 

When the State machine runs the numeric representation of the enum is shown in the Sampling Probe Watch Window.

 

I played a little with exporting the graph to clipboard and trying to decypher in the hopes I could cas the values back state names but I have not carcked that nut yet.

 

Thank you!

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 3 of 6
(2,870 Views)

To_States.png

 

 

Cracked the nut.

 

After "export to clipboard" the above code will give an array of the states and the order they were executed.

 

In the above I disconnected the enum from the type def. the original type def is from the Simple State Machine template. The above could be adapted to other state machines by replacing the enum with the type def that is used in the state machine.

 

Take care,

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 4 of 6
(2,863 Views)

There are some short-comings in the code I shared above. But the idea is sound and can be used as a tool. If you do so, watch out for the bit order. It is not straight forward.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 5 of 6
(2,842 Views)

@AnalogKid2DigitalMan wrote:

Ben:

 

Here is link to the Help (not that I read or understand it):

 

http://zone.ni.com/reference/en-XX/help/371599J-01/lvfpgahelp/using_sampling_probe/

 

-AK2DM

 


I've used this feature for FPGA VIs before but didn't know it could be used on a host VI, very cool.

Matt J | National Instruments | CLA
0 Kudos
Message 6 of 6
(2,829 Views)