Motion Control and Motor Drives

cancel
Showing results for 
Search instead for 
Did you mean: 

Newport SMC100 raises Error 7 after compiling + solution

In a test program I tried to open and close the communication to the Newport SMC100 translation stage controller, using an RS232 connection. 1_test_VI.jpg

 

When I run the program in LabVIEW it works properly. When I compile the program and try to run that, it gives an error 7:

Error 7 occurred at New File
Possible reason(s):
LabVIEW:  File not found. The file might be in a different location or deleted. Use the command prompt or the file explorer to verify that the path is correct.
=========================
NI-488:  Nonexistent GPIB interface.

 

2_error_message.jpg


It turns out that the problem is in NP_Logging.vi (called by, among others, "_Create Instrument Channel.vi"). It wants to make a log file with the same path as the VI. This fails after compiling.

NP_Logging.vi is called in a lot of VI's and I just disabled the code in the VI. After recompiling my program now works. Pity about the logging though.

 

3_NP_logging.jpg

I hope this helps others.

 

Software versions:

LabVIEW 2015 32 bits

Windows 7 64 bits.

0 Kudos
Message 1 of 5
(4,468 Views)

Hi rb232,

 

 

The disabled code strips the path of the current VI (takes it a folder back in windows) so C:\Users\pwood\Documents\test\ThisVI.vi" becomes "C:\Users\pwoodwar\Documents\". So it may be that the file path is incorrect on the Newport SMC100. You could use probes to see what file path it is using and then debug it from there if you need it.

 

Otherwise it is a good work around you found.

 

Cheers

 

Pete

Applications Engineer

National Instruments

 

 

Certified LabVIEW Architect
0 Kudos
Message 2 of 5
(4,451 Views)

Hi Pete,

 

In debug mode the path is "C:\Program Files (x86)\National Instruments\LabVIEW 2015\user.lib\SMC100 Controller_Drivers/Data.log" -- which exists. After compilation the path is a subfolder of the executable, which does not exist or isn't writable or whatever:

4_path.jpg

 

NP_Logging uses old (unsupported) LabVIEW VI's for writing to files. These don't have an error out indicator but an error dialog that pops up. After I replaced them with modern writing-to-file-VI's and dumped the error in an indicator, the test program worked fine after compiling.

5_old_VI.jpg

 

I don't really care about the logging by the translation stage (I build a fair amount of logging into my own program), so I'll report the problem to Newport and let them fix it properly. I'll include my new version of NP_Logging.vi to this post for others to look at/use/enjoy.

 

Best,

 

Robbert

 

 

0 Kudos
Message 3 of 5
(4,423 Views)

Hi Robbert,

 

With regards to the path not existing once the program is an executable, this is probably due to the use of "Current VI's Path" on stage 0 of the stacked sequence structure. If you change this to "Application Directory" and build your own path rather than stripping the VI path down. For example you may have a folder that you are saving all your own log data too. If Application Directory is used then it will use the directory where the Exe is stored as its base path.

 

This is a great document that talks through it: http://digital.ni.com/public.nsf/allkb/FD7DE8BC8FFC256C862565F4006BE363

 

The reason that the program was stopping to pop up the error dialog is probably due to automatic error handling. When you wire the error to an indicator it is trying to send that information on to a higher level VI.

 

More info on handling errors can be found here: http://www.ni.com/getting-started/labview-basics/handling-errors

 

Hope this helps

 

Pete

Certified LabVIEW Architect
0 Kudos
Message 4 of 5
(4,418 Views)

Hi Pete,

I think that is something that the people from Newport should take a look at -- I'm going to continue building my instrument 🙂

Thanks,

Robbert

0 Kudos
Message 5 of 5
(4,416 Views)