Jump to content

Graph to display all previous activity


Ano Ano

Recommended Posts

Hello,

I got 10 on-off switches,

When switch number "X" turns on I want to display its change in a graph (bar plot) that it turned on (y-axis value/amplitude 1 if it turns on) and on x-axis display the time that it turned on (see attached picture).

When other switch turns on then I want the graph to display all previous switches activity (with their time stamp (in sec)).

This has to be a graph so that I can put cursor labels on each bar.

Any ideas how to do this?

Thank you in advance

post-20867-0-65066700-1318326580.jpg

Link to comment
Thank you for the help!

My pleasure :)

I have an issue though...If the "switches" control becomes and indicator, then the vi does not work! (see picture here http://imageshack.us...eindicator.jpg/)

Right - the code I gave you is a place to get started - you need to work out how to put it into your higher-level application. Hint: the event structure acts when the switches array is changed, so you can't use that: try keeping the state of your switches indicator in a shift register, and comparing that with the new value to get your two Boolean arrays. Another option is to use the OpenG "Changed?" VI to select whether to execute my code or not.

Link to comment

try keeping the state of your switches indicator in a shift register, and comparing that with the new value to get your two Boolean arrays

Hello & Thank you very much ...again!

I used two things to get it working:

1. The shift register

2. I wired the output of the boolean array with a property node "val(signl)" linked with the "switches" indicator that was inside the event structure

The problem now is that with both solutions the code is a bit slow...what am I doing wrong?

Link to comment

Hello,

I thought to write an update.

While playing around with the codes limits I noticed that if the boolean array is longer than 32 elements/switches then the code does not display the change of the booleans (numbered from 33 and above) in the graph.

Why is that happening?

Link to comment
I wired the output of the boolean array with a property node "val(signl)" linked with the "switches" indicator that was inside the event structure

Yep - that'll work nicely - good job.

While playing around with the codes limits I noticed that if the boolean array is longer than 32 elements/switches then the code does not display the change of the booleans (numbered from 33 and above) in the graph.

I don't have the code in front of me, but maybe the conversion to number (to decide which Boolean has transitioned from false to true) is set to only I32?

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.