From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

situational graph

Hello,

 

i'm using DIAdem 2012 . 

I want to present a situation graph (e.g. on and off) over a certain time . 

I Dont want to insert a value for each timestamp, only where there is a change .

The graph should be like this(rectangle): 

 

            _____           _______

_____|            |____|                |___________

 

the result i'm having is this(saw tooth):

 

 

   /  \         /  \            

  /    \       /    \

/        \    /       \

 

what is the answer for this problem?

0 Kudos
Message 1 of 10
(5,199 Views)

Hi OmerK,

 

Did you try the option "Outlined bars"?

(See attachment)

 

Greetings

Walter

0 Kudos
Message 2 of 10
(5,188 Views)

Hi Walter,

 

I was succeeded to create the situationagraph in the report tab.

 

Can i get the same effect in the view tab when i crate a 2D axis system graph?(cause there i can zoom in/out and play synchronized video)                                                             

Threre is some property window to do that in the view tab?

                   

My graph:  Graph represents turning on and off state-we convert text values - on and off , to 1 and 0 integer value

- that is what we get: 

  _              ______

    \            /             \       

      \____/                \____

                                                                     ________     _____

I want my graph will look like this:   ____|                 |__|           |____

 

thanks and waiting for reply

0 Kudos
Message 3 of 10
(5,180 Views)

Hi OmerK,

 

I' sorry, but in VIEW this kind of graph is not available. In this case you need to insert a value for each timestamp.

 

Greetings

Walter

0 Kudos
Message 4 of 10
(5,177 Views)

Hi Omer,

 

Have you tried the 2D graph curve type "Stair curve" in VIEW?  Depending on your data, that may give you the display you want.  Could you post or send us your data?

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

brad.turpin@ni.com

0 Kudos
Message 5 of 10
(5,163 Views)

Hi Brad,

 

You are right. Thank you!!!

 

Walter

0 Kudos
Message 6 of 10
(5,150 Views)

Hello Brad,

 

Tanks it's working!!!

 

Another question:

Could i give DiAdem a  situational graph (more than 2 situations like: on off restart sleep etc...) and he transfer this into integer channel- (numeric values like enum: on=0, off=1, sleep=2, restart=3...) automatically?

 

Thanks and waiting for reply

 

 

0 Kudos
Message 7 of 10
(5,147 Views)

Hi Omer,

 

DIAdem can do that with a channel calculation.  Can you send an example data file?  I can then send you back a VBScript or a Calculation Manager calculation that does the enumeration-->integer conversion.

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

Message 8 of 10
(5,123 Views)

Hi Bred,

 

I can't send you my data cause it's classified.

My data looks something like this:

(this is text channel)

 

on

on

on

on

on

off

off

off

off

sleep

sleep

sleep

sleep

sleep

on

on

on

off

off

 

..........

 

 

thanks and waiting for reply

0 Kudos
Message 9 of 10
(5,096 Views)

Hey OmerK,

 

There are a few different approaches to performing the calculation. One way would simply be to go row-by-row through your data and compare each value to a set of states and assign it an integer based on that. For a small set of data, this would run extremely quickly and would be an appropriate solution to the problem. To make things run faster, though, you could use a channel calculator formula to perform the conversion.

 

The basic technique is to use nested IIF statements. Here's a very simple example, where Enum Strings is the channel of your original data, and Enum Ints is the resulting numeric data:

 

Ch("[1]/Enum Ints") = IIF(Trim(LCase(Ch(CNo("[1]/Enum Strings"))))="on", 1,0)

 

This formula will cause all "on" entries to become 1's, and everything else to become 0's. If you can ensure that entries will always be in lowercase, you can remove the LCase() call, and if you can assume they will not contain extra whitespace, you can remove the Trim() call, and get this:

 

Ch("[1]/Enum Ints") = IIF(Ch(CNo("[1]/Enum Strings"))="on", 1,0)

 

To add more possible states (such as your "sleep" state), you simply need to nest another IIF statement where the "0" argument is at the end of the previous examples. Here's one that sets "on" to 1, "off" to 0, and "sleep" to 2:

 

Ch("[1]/Enum Ints") = IIF(Trim(LCase(Ch(CNo("[1]/Enum Strings"))))="on", 1, IIF(Trim(LCase(Ch(CNo("[1]/Enum Strings"))))="off", 0, IIF(Trim(LCase(Ch(CNo("[1]/Enum Strings"))))="sleep", 2, 0)))

 

It's probably easier to run a formula like this in a script. Here's an example script that performs the calculation and then displays the VIEW window:

 

L2 = CNo("[1]/Enum Strings")

FormulaTxt = "Ch(""[1]/Enum Ints"") = IIF(Trim(LCase(Ch(L2)))=""on"", 1,0)"
Call ChnCalculate(FormulaTxt)
Call WndShow("VIEW")

 

 

 

If you have a small number of states and a large amount of data, this is the most efficient way to process the data. However, this does require you to know the number of states in advance--if this is not a given, you can build the nested IIF statements in a loop.

 

I hope this helps! If you need any more assistance, please let us know.

0 Kudos
Message 10 of 10
(5,064 Views)