Graph X Axis


Recommended Posts

I would like to create time base X-Axis, however the Time  doesn't need to be current time. It needs be cycle time say for eg 8 sec which I vary maximum to 1 sec in every cycle and I receive the value on a variable from my PLC. The major issue being I get too much data for that 8 sec. and the graph doesn't show that value, any suggestion for that.

Moreover how do I further increase enlarge to millisecond in the X-Axis. 

Also, how the example base scripting given doesn't show in the user guide. For eg the pdf based example on samples of pdf which was a shocker to me.

furtherly what coding base does the software use so can follow the same.

Appreciating the timely based response.

Link to comment
Share on other sites

To display delta T on the X axis you simply need to record the time of the 0 point, and then subtract that from the data time stamps.  So if you are plotting "MyChannel" vs "Time", and you create a global variable called "StartTime" which you set in, say, a button when the process starts:

startTime = systime()

Then, the graph would be "myChannel" vs "GetTime(myChannel) - startTime"

As for milliseconds, when in Date/Time mode, the graph doesn't show millisecond graduations.  To do that, and especially when you are actually doing deltaT, just change the Bottom Axis from "Date/Time" to "Lin"

The user's guide doesn't show every because some features are considered beta.  PrintPDF() for example only support generating PDFs of certain controls, namely the graph control and text controls.  It won't, for example, print a bitmap logo.  As such, we did not document it in the user's guide so it isn't really fully functional. 

The script in DAQFactory is loosely based on C++ and Visual Basic.  It is mostly similar to C++, but with some parts (ie. endif, endwhile, etc) of Visual Basic.  The syntax was chosen to give the flexibility and power of C, while not making the syntax so strange that beginners couldn't make sense of it.  So, for example, unlike in C where you can basically create an entire program in one line, DAQFactory limits you to one statement per line.  Likewise, DAQFactory has a number of things, namely how it deals with arrays and strings, that are not easy to do in C or Visual Basic.  For example, if "x" is an array, and you want to add 1 to every element in X, in C you would have to create a loop and increment each element.  In DAQFactory it is simply x = x + 1, or even x++.


Link to comment
Share on other sites

Firstly thank for the wonderful understandable response.

Secondly would be possible in "Lin" if my X axis comes from a timer from the PLC and would I be able to get milliseconds. In my case there are 3 variable to plotted in graph and to be shown for each cycle. Also, task being that X axis remains same however the Y axis varies so can there be a continuous Y axis from 0-10 for one variable ,0-1900 in the same Y-axis for second variable and 0-180 for the third variable.

Link to comment
Share on other sites

So are you saying that you have a 4th channel from the PLC with the timestamp of the process that you want as the X axis?  You can certainly do that.  Just put that channel name as the X Expression.  Likewise, you can plot all three variables, either on the same axis, or, given your ranges, on 3 separate axes, left or right.

Link to comment
Share on other sites

  • 3 weeks later...

Thank your

The now the X axis value is same,  lets say the channel name is time is same for  3 other variable which needs to be plotted along the Y axis. The value first variable is from 0-30 , second variable value ranges from 0-360 and the third variable value ranges from 0-1700. So, can there be a graph plotted whose Y axis value has of 3 different range of 3 variable . Firstly the value of Y axis starts from 0 -30 ,now above the 30 value there would be a value from 0-360 on the same Y axis with a new origin on the same line, say the same graph. Additionally, the Y axis of third variable from 0-1700 ,now the 0 of the third variable needs to be above the max value of variable two . There is an attached image file, however such a graph is not required. The requirement is on a single Y axis with values of Y axis of different variable one after another.


Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

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.