2D graph and Channel Timing set to 0


BeeHay

Recommended Posts

I'm having a tough time setting up a 2D graph for my "Counts" channel that's setup on my Labjack U3-HV...

Now I believe it has something to do with the Timing set to "0", but I'm not completely sure...

Even using the "Counts" with math on it in another variable will not graph either.

Also would like a little more info on how to make my graphs vertical, please... :o

Thanks!

Link to comment
Share on other sites

  • 2 weeks later...

OK, we can't share the full document on the forum, but for everyone else, the problem with BeeHay's document was that he was graphing a global variable and simply assigning a new value to it. Something like this:

global mytrace

while(1)
   mytrace = sum(somechannel[0,50])
   delay(10)
endwhile

Well, the problem is that the mytrace never develops any history. Its always a scalar value containing the last result. To create a history in the variable, you need to use the AddValue() member function of the variable (note this does NOT work in Express, you'd have to use a separate Test channel for this):

mytrace.addvalue(sum(somechannel[0,50])

When using AddValue you usually want to make sure you have the right time assigned. So to make sure the new data point is assigned with the current time:

mytrace.addvalue(inserttime(sum(somechannel[0,50]),systime(),0))

Link to comment
Share on other sites

  • 1 month later...

Hello again and thanks for the pointers of inserting time... :)

Now yet, another speed bump I've encountered about the vertical graphs.

I have gotten the graph to look "vertical" with my Depth as the Y axis.

Now getting the trace to show in the graph has me stumped.

Sometimes I can get the trace to show, but it doesn't "draw" the trace line.

Is this because I can't choose "Bottom Axis" from the axis drop-down menu on the traces tab of the graph properties box?

When I can get the trace to show in the graph, it is coming from the middle of the graph, and acting like a horizontal bar graph.

There is another small issue I'm having besides that.....

Now that I have made a symbol "move" left to right on the screen (a forklift), I can not Ctrl+Click on the symbol to move it around.

Do I have to delete the component positions sequence, move the symbol/component, then re-do the sequence?

Also, is there a way to password protect my .ctl file?

Probably an Auto-Starting sequence is I how I see it working in my mind, just not sure what it should look like 'cause I'm not sure what the "Switch to Development" option is called (if it is even named) in DF.

Thanks for EVERYTHING Azeotech!!

Link to comment
Share on other sites

I've attached a sample showing a vertical graph. You have to treat it as an XY graph, not a regular trend graph. This means changing the bottom axis to Lin, and unchecking Use Time Width.

If you are moving the component using the X/Y position parameters of the component, you need to click on the original position of the component, not the drawn position. To avoid this, use the MoveTo() function of the component from a sequence. You'll need to name the component.

You can put a password on editing a document by going to File - Document Settings and entering a document editing password. If you want a password for running, you'll need to do that, plus you'll need to make the initial page of your document something that has a login.

vertgraph.ctl

Link to comment
Share on other sites

Here is an example of how I am trying to use it.

I changed the scaling on the Left Axis 1 in the Axes tab to scale from Depth+5 to Depth, and the bottom axis is scaled from 0 to a slider bar.

Thanks again!

Link to comment
Share on other sites

Does Depth have any history? From your use in the scaling of the left axis, I'd say not. Also, "Channel1(200-10)" is invalid unless Channel1 is actually a function, not a channel. Did you mean Channel1[200-10]? If so, that is a scalar as well so won't graph. Remember graphs have to plot arrays (history). Neither the X nor Y expression can be scalars. Also, if you are not plotting a value vs its own time (i.e. doing a true XY), there may be alignment issues. Set the Align Thresh of the bottom axis to -1 to turn this off. Finally, I'm assuming slider_scaler is a global variable controlled by the slider and initialized elsewhere.

Link to comment
Share on other sites

You are correct, Depth does not have a history, but the graph does move correctly while Depth is running...

And when I did Channel1(200-10), I was just using a fake expression of my value I wanted graphed.

Probably should have put in something like gas*2000-10 on my X axis as a sample expression...(gas = my channel 1 on my daq board)

And yes, the slider is a global variable controlable slider.

Thanks!

Link to comment
Share on other sites

I think I got it...

Instead of having something like this in my X expression - Gas[0]*2000-10 (one history point)

I need something like this - Gas[0,250]*2000-10 (multiple history points)

Haven't tested it out yet and am not quite sure if it'll work, but I'm headed in to work in a bit to try it out.

:)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.