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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to typecast a table control to connect with VISA

Solved!
Go to solution

As VISA can accept string buffer only,how can we connect a 'table control with VISA?

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Thanks as kudos only:)
0 Kudos
Message 1 of 13
(2,546 Views)

You mean to Visa Write? And if so that depends on what your remote side expects. You could for instance extract the table content and format it into a Spreadsheet string with the Array to Spreadsheet node. Or maybe you need a different format that you could build inside one or two loops with a shift register.

 

But there is no generic way to do what the title says, because it will always depend on what the remote side expects.

Rolf Kalbermatter
My Blog
0 Kudos
Message 2 of 13
(2,536 Views)

Thanx for reply.What Iam trying to do is to read a table from one port(COM3) and display it in another port(COM4).Both ports are connected using prolific USB-to-serial COM port(a cable).VI is attached below.

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Thanks as kudos only:)
0 Kudos
Message 3 of 13
(2,533 Views)

Edit. What are you trying to do? You receive a string and nothing but a string per read. Why do you want to display that string in a table? Simply use a string Control and forget about String to Bytes and Typecast and vice versa altogether.

Rolf Kalbermatter
My Blog
0 Kudos
Message 4 of 13
(2,526 Views)

Sorry I edited the attachment.Please check.

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Thanks as kudos only:)
0 Kudos
Message 5 of 13
(2,524 Views)

Actually trying to read the contents in the table(now it is empty) and write it as a table itself.

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Thanks as kudos only:)
0 Kudos
Message 6 of 13
(2,517 Views)

But you fill the table with a (not working) conversion from a VISA read first. So what are you trying to do there? I do have a hunch that you try to display each indivual byte in one row and one row per loop iteration but that would require a complete remodeling of your code and the use of a shift register to maintain a history of the previous reads. Also you most likely wouldn't want to write the entire table with all previous strings on each loop iteration either, so the idea to use the table to hold the data between the read and write is completely flawed in the first place.

 

Not knowing what your final intentions are with this it is absolutely impossible to give you good alternatives to what you have now. The only thing I can say with 99% probability is that what you have now is not what you really want.

 

Also there doesn't exist something like a universal representation of a table in string form. The closest to this is a spreadsheet string, but that can be with tab, comma, or whatever seperator and various number formats.

Rolf Kalbermatter
My Blog
0 Kudos
Message 7 of 13
(2,510 Views)

Hello,There is an example in Labview2009 named '2 port serial read and write'.In that example I successfully read and write a string.And now Iam trying to read and write a table instead of the string buffer.

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Thanks as kudos only:)
0 Kudos
Message 8 of 13
(2,504 Views)

and what is the format of that table you want to read?

Rolf Kalbermatter
My Blog
0 Kudos
Message 9 of 13
(2,502 Views)

Format?I dont understand cleary?If a simulator in the form of a table(VI attached).

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Thanks as kudos only:)
0 Kudos
Message 10 of 13
(2,499 Views)