LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Printer not work in executable

Hi,

i will work with a label printer. It is connect over usb. In LV environment it works. When i build exe for a target, the application does not work on it.

 

SeppR_0-1706806437095.png

 

SeppR_1-1706806491363.png

 

 

SeppR_2-1706806538751.png

 

Resourcename is copy from NI MAX

 

0 Kudos
Message 1 of 16
(1,788 Views)

Is your development environment closed? It doesn't need to be, but if a VI opened a reference and didn't close it properly, another application (like the exe) won't be able to open a reference.

 

If MAX opened the reference it might claim the resource too. 

0 Kudos
Message 2 of 16
(1,770 Views)

Are you running the EXE on the same PC as the one it works in the LV environment on, or a different PC?  If it's a different PC, is it also a different printer?  Since the serial number of the device is part of the USB RAW VISA string.

 

Can you try putting a "VISA Find" in the application, to see what resources it does see in case it's different there somehow?

0 Kudos
Message 3 of 16
(1,768 Views)

The exe is running on a different pc then the LV environment.

0 Kudos
Message 4 of 16
(1,704 Views)

The exe is running on a different pc than the LV environment, but the printer is the same. Develop on the LV environment --> exe run on different pc

0 Kudos
Message 5 of 16
(1,702 Views)

Have you checked the VISA name in MAX on the PC which is running the EXE? (2nd question: do you have MAX installed on the latter at all?)

0 Kudos
Message 6 of 16
(1,684 Views)

@SeppR wrote:

The exe is running on a different pc than the LV environment, but the printer is the same. Develop on the LV environment --> exe run on different pc


It's probably NOT the same printer - at least to VISA.  It's probably better to assign the same alias to the printer in MAX on both PCs and use that instead of the VISA resource.  Probably the printer has different VISA resource names on each PC.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 7 of 16
(1,677 Views)

On the pc which is running the exe i have install VISA runtime but not MAX.

 

0 Kudos
Message 8 of 16
(1,672 Views)

@SeppR wrote:

On the pc which is running the exe i have install VISA runtime but not MAX.

 


Well, I guess this is a problem, your printer might got a different VISA name under the other PC.

 

I would assign a proper alias name to the printer. Why would you refer to it as USB::0... whatever if you could simply call it as "Printer". Then I would install MAX on the second PC and assign the same alias to the printer.

 

Alternatively - as others suggested - you can list the visa names of the second PC and write your program smart enough to select the right one for you automatically, but personally I'd definitely go with the first one.

0 Kudos
Message 9 of 16
(1,661 Views)

The problem is actually a little more involved than most of you guess. A USB Raw VISA resource is a low level USB resource that needs to be installed on a computer. VISA does not automatically get access to all USB resources. Instead you create an INF file in the VISA driver wizard and that INF file "installed" (really assigned) the VISA USB driver as driver for this device.

 

You need to have NI VISA Runtime with USB support installed and run the VISA INF file for that device on the according computer. On Windows 10 systems the according INF file needs to also be signed with a certificate in order for this to work. Not sure if the default VISA Runtime installer has all the provisions for this to work.

Rolf Kalbermatter
My Blog
0 Kudos
Message 10 of 16
(1,631 Views)