DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

DIADEM STRING VARIABLE SET

I am using the DIADEM STRING VARIABLE SET.vi in LV8.6.1 to set the T3 variable in DD11.1.

 

the string is being truncated 

 

For example I sent 1527 characters

------start ------

Custom_Count=0&Plot_Size=Letter&Plot_Orientation=Landscape&Plot_Count=1&Plot1_Style=S Parameter&Plot1_UseTestSetup=1&Plot1_Run_Mode=Most Recent&Plot1_Run_Field=Step_Tag&Plot1_Run_Field_Value=&Plot1_LineType=0&Plot1_X_Unit=MHz&Plot1_X_Min=500&Plot1_X_Max=800&Plot1_AxisType=Split&Plot1_Auto_X=1&Plot1_Auto_Y=1&Plot1_Y_Format=Delay&Plot1_Scale=10&Plot1_Reference=0&Plot1_Position=5&Plot1_Curve1_Parameter=S11&Plot1_Curve1_LimitOn=1&Plot1_Curve1_LimitFill=0&Plot1_Curve1_Label=LABEL&Plot1_Curve1_Autoscale=1&Plot1_Curve1_Scale=2.5&Plot1_Curve1_Reference=-50&Plot1_Curve1_Position=0&Plot1_Curve1_Format=Log Mag&Plot1_Marker1=1000&Plot1_Marker4=Limit Maximum&Plot1_Marker2=Trace Maximum&Plot1_Marker3=Trace Minimum&Plot1_Marker5=Limit Minimum&Plot1_Curve2_Parameter=S21&Plot1_Curve2_LimitOn=1&Plot1_Curve2_LimitFill=0&Plot1_Curve2_Label=&Plot1_Curve2_Autoscale=1&Plot1_Curve2_Scale=10&Plot1_Curve2_Reference=0&Plot1_Curve2_Position=5&Plot1_Curve2_Format=Phase&Template_dHeight=8.500000&Template_dWidth=11.000000&Plot1_run_id=&preview=1&report_path=C:\DEVELOPMENT\SPARTAN\www\temp\preview_preview_99452782.png&data_path=C:\DEVELOPMENT\SPARTAN\data\tdm&test_status=&ReportFooter_txt=&serial_number=

------ end ------

 

but received only 1192 characters in Diadem

 

------start ------

Custom_Count=0&Plot_Size=Letter&Plot_Orientation=Landscape&Plot_Count=1&Plot1_Style=S Parameter&Plot1_UseTestSetup=1&Plot1_Run_Mode=Most Recent&Plot1_Run_Field=Step_Tag&Plot1_Run_Field_Value=&Plot1_LineType=0&Plot1_X_Unit=MHz&Plot1_X_Min=500&Plot1_X_Max=800&Plot1_AxisType=Split&Plot1_Auto_X=1&Plot1_Auto_Y=1&Plot1_Y_Format=Delay&Plot1_Scale=10&Plot1_Reference=0&Plot1_Position=5&Plot1_Curve1_Parameter=S11&Plot1_Curve1_LimitOn=1&Plot1_Curve1_LimitFill=0&Plot1_Curve1_Label=LABEL&Plot1_Curve1_Autoscale=1&Plot1_Curve1_Scale=2.5&Plot1_Curve1_Reference=-50&Plot1_Curve1_Position=0&Plot1_Curve1_Format=Log Mag&Plot1_Marker1=1000&Plot1_Marker4=Limit Maximum&Plot1_Marker2=Trace Maximum&Plot1_Marker3=Trace Minimum&Plot1_Marker5=Limit Minimum&Plot1_Curve2_Parameter=S21&Plot1_Curve2_LimitOn=1&Plot1_Curve2_LimitFill=0&Plot1_Curve2_Label=&Plot1_Curve2_Autoscale=1&Plot1_Curve2_Scale=10&Plot1_Curve2_Reference=0&Plot1_Curve2_Position=5&Plot1_Curve2_Format=Phase&Template_dHeight=8.500000&Template_dWidth=11.000000&Plot1_run_id=&pr

------ end ------

jim

0 Kudos
Message 1 of 6
(4,784 Views)

I  found that a 0x00 character was embedded in string causing string termination.

 

I also found that the ' character causes  popup in dd . how can i escape this character?

 

jim

0 Kudos
Message 2 of 6
(4,780 Views)

I do not think that there is an way to escape the 0x00 character which is used to terminate strings in some programing languages. So most time you have to escape on your own if you want to transport binary data using a string.

 

Most times base64 encoding is used to do this job.

 

So the side setting the string has to encode it in base64 and the other side has to decode back.

The advantage of base64 is that it is only using  A–Z, a–z, 0–9, + to encode the data.

 

Never tried things like this in DIAdem.

 

Looks like it might be easier to write the information to an file and load it in DIAdem using a dataplugin or whatever.

 

Greetings from cloudy Germany

Andreas

 

0 Kudos
Message 3 of 6
(4,757 Views)

actually, i consider the 0x00 character my bug and I removed it. 

 

however,the ' character is an NI bug in my opinion.

 

jim

0 Kudos
Message 4 of 6
(4,754 Views)

Hi Jim,

 

The problem here is that DIAdem's ActiveX servers still use the old autosequence syntax, where strings constants can be created with the apostrophe ( ' ) character instead of the more usual double-quote ( ") character.  So if I were to send a command from LabVIEW to DIAdem to assign the string "hello" to the variable "T1", it would look like this:

 

T1:= 'hello'

 

So I agree with you that the ( ' ) character termination is DIAdem's fault, but it would be more a designed behavior than a bug.  It was also possible in an autosequence to use the normal ( " ) character to specify a string constant, like this:

 

T1:= "hello"

 

Actually, when I try to use the "CmdExecuteSync" method I am able to sidestep the ( ' ) character termination problem, whereas the "TextVarSet" method reproduces it.  I'd recommend using the VI equivalent of "CmdExecuteSync":

 

Set ToCommand = CreateObject("DIAdem.ToCommand")

Call ToCommand.CmdExecuteSync("T1:= 'hello'")

Call ToCommand.CmdExecuteSync("T1:= ""he'llo""")

'Call ToCommand.TextVarSet("T1", """hello""")

'Call ToCommand.TextVarSet("T1", """he'llo""")

Call ToCommand.TextVarGet("T1", TextVar)

Set ToCommand = Nothing

MsgBox TextVar

 

Brad Turpin

DIAdem Product Support Engineer
National Instruments

0 Kudos
Message 5 of 6
(4,734 Views)

In LV, I did my own detection for the ' and replaced the ' with XXXXXXXXX then put back the ' in DD.

 

jim

0 Kudos
Message 6 of 6
(4,730 Views)