09-08-2010 12:03 PM
Hi everyone,
I'm using Labview and DIAdem to create graphical reports and i'm using the connectivity VIs and not the Express VI.
The data is stored in a MySQL Inno DB.
I'm using the following command to get the data that i want to show in the graphical report!
SQL_ExecDirect("select `TimeStamp` , `Value` from `TableX` where and Sample='%s' and Channel='%s';")
And then I use:
SQL_BindChannel("Datetime1C1" , "TimeStamp" , "t","#yyyy-mm-dd hh:nn:ss") to bind the data for X axe of the graph.
And after that I use:
SQL_BindChannel("SampleN","Value","n") to bind the data for the Y axe of the graph.
As I want to create the graph with more than one Sample, I use the commands above on a loop.
Now here is a printscreen of my problem.
In the first Iteraction( green line), DateTime1C1 has the timestamp for sample1 but in the second Iteraction (yellow line) DateTime1C1 has the timestamp for sample2, in the third iteraction (Blue Line) DateTime1C1 has the timestamp for sample3. etc.
The original timestamp for each sample are "lost" it re-writes datetime1C1. and in the end it show only the timestamp for the 5th iteraction.
How can I create a graph with multiple lines (Samples) and one unique datetime axe?
Thx in advance
Solved! Go to Solution.
09-09-2010 08:32 AM
Hi AlexandreHSCas,
If I understand your situation correctly, the only thing you need to change is to create a new Group in the DataPortal before each query.
FOR i = 1 TO iMax
NewGroupName = "Query " & i
Call GroupCreate(NewGroupName)
Call GroupDefaultSet(GroupCount)
Call SQL_ExecDirect("select `TimeStamp` , `Value` from `TableX` where Sample='%s' and Channel='%s';")
Call SQL_BindChannel(NewGroupName & "/Datetime1C1" , "TimeStamp" , "t", "#yyyy-mm-dd hh:nn:ss")
Call SQL_BindChannel(NewGroupName & "/SampleN", "Value", "n")
NEXT
Then you can just drag each Group from the Data Portal onto the same XY graph-- because each Group has its own time channel, the data points will show up correctly placed on the common X axis of the graph.
Brad Turpin
DIAdem Product Support Engineer
National Instruments
09-09-2010 09:44 AM
I'm gona give it a try!
Thanks Brad
09-27-2010 12:07 PM
Hi Mr Turpin !
the solution you provide has worked. thanks.
Now I have this "issue" I created a TDR with 2 scales... one on the left and the other on the right! In order to be able to analise (in the same graphic) several "Current" measurements plus a temperature measurement.
I want to put the current measurements on the left left scale and the temperature measurements on the right scale.
Can you or any other forum user help with that?!
09-28-2010 10:10 AM
Hi Alexandre,
Sure. Each Y axis you create can be placed either on the left side or the right side of the graph, and each curve can be assigned to whichever Y axis you choose. So you just need to open the "Curve and Axis Definition" dialog for the graph, go to the "Axis Position" tab, then in the first "Reference" column choose "Axis begin" for the current Y axis and "Axis end" for the temperature Y axis.
Brad Turpin
DIAdem Product Support Engineer
National Instrumets