LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

.net Array Input as ref

Not Kyle, but I'll take a shot anyway...

What exactly did you put in the string control?

If you write something like

<inArgs><scannerID>12345</scannerID></inArgs>

you might have some luck (where 12345 is the "scannerID" value).

 

In this case, a snippet showing the front panel would have been useful so we could see - block diagram constants are a good choice for forum debugging since then we can see code + inputs.

Please note that a snippet isn't the same as a screenshot - you can create snippets using the menu path Edit > Create VI Snippet.


GCentral
0 Kudos
Message 11 of 16
(849 Views)

Hi

 

Is there any specific method to write code in XML string constant. JKI Xml tool kit is effective to write the code?

 

Thanks in advance.

0 Kudos
Message 12 of 16
(831 Views)

Hi

 

Is there anyone to help me? How I can apply XML file as input to the labview?

I tried to convert the string input to XML file. . And I received the string output as given in the attached image. But it didn't work. If someone has a relevant example, please share it with me.

I will appreciate any reply.

Regards and Thanks.

0 Kudos
Message 13 of 16
(820 Views)

The problem in the examples you've shown is that you have bits like "scannerId.ToString()". This is a C# method call to convert the scannerID (a number, presumably) to a string, so that you can put it in your XML (as a string).

 

The equivalent LabVIEW code would be something like this:

Example_VI.png

 

I usually prefer the use of Format Into String for building commands/argument strings, but you can also do it piece by piece with e.g. Concatenate Strings and Number to Decimal String.


GCentral
0 Kudos
Message 14 of 16
(807 Views)

Hi Cbutcher,

Thanks for this code. I tried JKI easy xml and generated the XML. 

Plaese take a look. Is it Ok.

Matharoo_0-1618249840082.png

 

0 Kudos
Message 15 of 16
(788 Views)

@Matharoo wrote:

Hi Cbutcher,

Thanks for this code. I tried JKI easy xml and generated the XML. 

Plaese take a look. Is it Ok.

Matharoo_0-1618249840082.png

 


That looks fine based on my "from this forum only" level of understanding regarding your problem.

My previous post gave a way that didn't require toolkits, but of course if your real code/structure is more complicated than just a few tags then using something like the JKI toolkit is a sensible choice that will make your code clearer (hopefully)!

That's especially true if you populate the cluster in various locations, or make use of the component parts, etc.


GCentral
0 Kudos
Message 16 of 16
(774 Views)