rotating 2d graphs, edit boxes


Recommended Posts

just wondering if you are able to rotate the 2d graph/ or trace so it will be displayed vertical instead of horizontal?

also wondering about edit box components, what do i need to make in order just to count an entered value and be displayed in a varial value component....

i have the edit box setup to "set on button press"...

thanks!

brandon

Link to comment
Share on other sites

Yes you can rotate the graph, but its not as easy as it should be (and will be in DF 6.0). What you have to do is make the graph into an X/Y graph, putting:

GetTime(X expression)

in your Y expression, where X expression is whatever you put in the x expression (minus any static math).

Then change the X axis format to Lin (linear) and uncheck Use Time width.

The problem with this is that the Y axis, which is now time, will display in DAQFactory time, not in human readable time, so you'll get numbers around a billion. You can hide this display and then create your own static labels if you want.

As for the edit boxes: I don't understand what you are asking, can you provide more detail?

Link to comment
Share on other sites

thanks for the rotation help, i think we'll leave it horizontal until df6 :)

as for the edit box, it just needs to take a number, i.e. 31, and when the user presses the button provided, it adds to the last entered value and is displayed in a varial value component...

ie-

user enters 31 into the edit box and clicks the little button...

since there is no before value, 0, it displays 31 in a varial value component placed right under the edit box

the user enters 30 in the edit box and presses the little button,

the varial value shows now 61

just a way to keep a tally

thanks

Link to comment
Share on other sites

OK, that makes a little more sense:

1) declare two variables in an auto-start sequence:

global valuetoadd = 0

global currenttotal = 0

2) create an edit box, have it edit ValueToAdd. Check "Set on Submit"

3) create a button, in the action, select "Submit", then hit Add to add a second action. The second action is a quick sequence:

currenttotal += valuetoadd

4) create a variable value component. Have it display CurrentTotal

That's it.

If you want a button to reset CurrentTotal, just create a single QuickSequence action in the button:

currenttotal = 0

Link to comment
Share on other sites

  • 9 months later...

Now almost a year since this post and have since added many edit boxes into my .ctrl file, and having a problem with a few of them...

Seems like when I press any of my Submit buttons, all of my edit boxes are submitted...

Tried just checking "Set on set button press" and it still submits all edit boxes...

Any info would be great! :)

Link to comment
Share on other sites

I got it figured out...It'll be ok for 3 of the edit boxes to be submitted at the same time, and I checked "set on set button" on a few other edit boxes, restarted my ctrl file a few times, and it is now working...

I do have a few other questions though that are OT...

1)

Seems like when I set my timing to anything above 2 on any channel, it causes "spiking" on a few of my channels and really throws thing off for a second...

Not sure why the spiking, but luckily I don't need timing right now on any my channels...

2)

Is it ok to set my symbol components to "NULL" so they can switch between symbols without the red X on them?

Just so they switch back and forth?

3)

Can I use ForNext loops? Is it called ForDo in DF?

something like this -

ValueToAdd = 0
while (ValueToAdd > Kelly)
  do DrillRate
  ValueToAdd++
endwhile

Not sure what the ++ does...does it add up ValueToAdd?

Thanks!

Link to comment
Share on other sites

1) the spiking is probably from hardware. DAQFactory doesn't create artifacts on its own

2) I don't know about NULL, but you can just set the expression to 0 to achieve what you want. There's nothing wrong with a constant expression.

3) Of course, its a for loop:

for (private valuetoadd = 0, valuetoadd < Kelly, valuetoadd++)

drillrate()

endfor

Your sample snippet won't work because you have > Kelly, but that's a minor detail. ++ means increment. Its just a short way of saying valuetoadd = valuetoadd + 1. You do not need to declare valuetoadd inside the for loop if it is declared elsewhere.

Link to comment
Share on other sites

  • 11 months later...

Thread resurrection. :)

Eureka! I have finally figured out the vertical graph problems I was running into.

The value I was trying to use in my "Y Expression" had thousands of data points, and the value I was trying to use in the "X Expression" had few data points.

All that was displaying was a squished "X Expression" value, looking like a straight line. :P

Also, it looked like the time wasn't matching up between the values I was using for the X and Y data.

Hopefully this can help someone out having problems with wanting to make their graphs vertical.

Whew, took nearly 2 years to figure that out. :bonk: :P

Link to comment
Share on other sites

Archived

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