Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with Serial Communication

            I am trying to write "\x59c\x3aimagesnap" to a scanner using the VISA serial read and write vi and I'm having problems reading the image from the scanner. When i type the same command in a terminal. I get the Image Data, the command read back to me in ASCII as well as any barcode scanned. When I use the VISA serial write and read vi., I receive just the information scanned from a barcode.

            I'm using one of the Example serial vi's as a test. the "Continous serial read and write.vi" under help  / find examples and type serial. Could I get help in how to create  a terminal-like output  within LabVIEW through a serial connected scanner?

Please and Thanks

0 Kudos
Message 1 of 13
(5,426 Views)

Without seeing the VI, it seems like there is more data in the buffer. You are probably reading it once and the VISA Read.vi is reading up to the first termination character or all of the bytes you are asking it to read.

 

Try putting your read in a loop until Bytes at Port equal 0.

0 Kudos
Message 2 of 13
(5,424 Views)

I attempted that and didn't get any far. I've decided to try to communicate it through .NET assemblys but I'm having a problem loading an example assembly and running it. I keep getting an error .
https://decibel.ni.com/content/docs/DOC-5921

 

theyre both in the same directory and I also tried to put them under the same project file.

I'm running an evaluation LabVIEW program if that helps at all

 

0 Kudos
Message 3 of 13
(5,386 Views)
You haven't provided the assembly that you are calling or the error code/message that you get. Like your first post, you haven't provided enough information to help.
0 Kudos
Message 4 of 13
(5,378 Views)

Sorry, the assembly( vi and dll) is provided through the link. I just loaded the vi and dll in the same directory and ran it through labview. initially I received this error:
error1.PNG
 Later, I double clicked on the construction node and input the TI83.dll into the assembly and received this error:
error.PNG
I'm an evaluation version of LAbVIEW 2014 if that helps.

0 Kudos
Message 5 of 13
(5,370 Views)

do you have the .NET framework installed?

0 Kudos
Message 6 of 13
(5,364 Views)
Why would you call a calculator assembly if you need serial port communication? The VISA functions are really all that you need. They provide for a terminal application if you use them correctly.
0 Kudos
Message 7 of 13
(5,359 Views)

I'm using a dll to get an image, serially, from a scanner. it works as a dll and im just using that post as an example of accessing .net assemblys. I'm attempted to try to read and write serially through VISA but it does not send me anything except what the barcode information that the scanner scans. If I talk to the scanner on a terminal, it sends me everything, including the barcode information.

0 Kudos
Message 8 of 13
(5,356 Views)

Yeah, It says i have Microsoft .NET Framework 4.6 installed

0 Kudos
Message 9 of 13
(5,351 Views)
You are not reading enough with VISA as already mentioned. For multiple line messages, you need multiple VISA Reads when you have the termination character enabled. You have to do a little coding and not blindly rely on the example to do everything for you. It was already mentioned to keep reading until the number of bytes is zero. If you know how many lines are being sent, a read inside a for loop could also be used.
0 Kudos
Message 10 of 13
(5,345 Views)