Discussion:
.SPC file format from Galactic Industries (for spectroscopy files)
(too old to reply)
DonRoth
2008-05-17 01:40:05 UTC
Permalink
Hi - I am needing to import galactic industries spectroscopy .spc format files (https://ftirsearch.com/features/converters/SPCFileFormat.htm) using LabVIEW in order to grab the spectra data and put it into .simple X-Y ASCII paired data (2 columns of data, 1 X and 1 Y).  Before jumping into writing a converter, I found this link on ni.com/support: http://zone.ni.com/devzone/cda/epd/p/id/3310However, it is unclear to me what this link's information provides or how it allows me to  read .spc files in LabVIEW.  Does anyone know what this link is talking about and has anyone written a data import utility for this file format before I start to?Thanks,Don
Eli_S
2008-05-19 21:40:04 UTC
Permalink
Hi Don,The link you are referring to is a plug-in that you need in order to be able to load the spc files. Please taka a look at <a href="http://zone.ni.com/devzone/cda/epd/p/id/4181" target="_blank">this link</a> for a LabVIEW code example and further explanation.
DonRoth
2008-05-20 17:10:09 UTC
Permalink
Hello Eli - followed all directions including registering of GRAMS_SPC.uri file and putting in appropriate information into the DataPlugin Load File.vi controls, but cannot get the file to unload its data (which is just 1 channel of X and Y data).&nbsp; This is a Galactic Industries SPC file that should work just fine.&nbsp; Can you please try it?&nbsp; I am attaching appropriate files. Thanks,Don


load_with_dataplugin_lv801.llb:
http://forums.ni.com/attachments/ni/170/325090/1/load_with_dataplugin_lv801.llb


grams_spc1.zip:
http://forums.ni.com/attachments/ni/170/325090/2/grams_spc1.zip


000010 SN11.spc:
http://forums.ni.com/attachments/ni/170/325090/3/000010 SN11.spc
Eli_S
2008-05-30 14:10:07 UTC
Permalink
Hi Don, I was able to try this and get it to work. This are the steps I took.1) Downloaded Load_with_dataplugin_lv80.llb2) Downloaded the SPC file you posted3) Dowloaded grams_spc.zip and extrated the file into the same folder as the other two files (mentioned in 1 and 2)3) Double-clicked on GRAMS_SPC.uri. A window came up and asking me if I want to replace the registered plugin. I said yes.4) Open DataPlugin Load File.vi and browse to the spc file5) Enter "GRAMS_SPC" (without the quotation marks) in the Data_plugin name field.Take a look at this screenshot for reference.<img src="file:///C:/DOCUME%7E1/eseidner/LOCALS%7E1/Temp/moz-screenshot-9.jpg" alt=""><img src="file:///C:/DOCUME%7E1/eseidner/LOCALS%7E1/Temp/moz-screenshot-10.jpg" alt=""> <img src="file:///C:/DOCUME%7E1/eseidner/LOCALS%7E1/Temp/moz-screenshot-11.jpg" alt=""><img src="file:///C:/DOCUME%7E1/eseidner/LOCALS%7E1/Temp/moz-screenshot-12.jpg" alt="">


spc_screen.JPG:
Loading Image...
DonRoth
2008-05-30 14:40:05 UTC
Permalink
My mistake was that I had used "GRAMS_SPC.uri" as the DataPlugin Name (not just "GRAMS_SPC").
&nbsp;
Now it works.&nbsp; Thanks for checking this for me!
&nbsp;
Also note that Thermo Scientific is now in charge of the GRAMS / SPC format.
(<a href="http://www.thermo.com/com/cda/product/detail/1,1055,10130922,00.html?flag=cma?ca=quantumgc" target="_blank">http://www.thermo.com/com/cda/product/detail/1,1055,10130922,00.html?flag=cma?ca=quantumgc</a>)
&nbsp;
Sincerely,
&nbsp;
DonMessage Edited by DonRoth on 05-30-2008 09:18 AM
Eli_S
2008-05-30 14:40:05 UTC
Permalink
glad it is working. I actually made that same mistake the first couple of times I tried it! :smileyhappy:
DonRoth
2008-05-30 15:10:08 UTC
Permalink
A few more questions: 1) The actual X stream (channel 1) of the file actually starts at X = -25.8 but the software result shows it as starting at X = 0.&nbsp; Is there a way to pull out the header information within your code (your code is password-protected) which contains Xstart, Xend, and number of points.&nbsp; Right now, my strategy is going to be opening the file, extracting those parameters from the header, close the file, calculating Offset and Multiplier, then execute the dataplugin code and scale the waveform according to offset and multiplier.&nbsp; Can I get access to your password-protected code?2) I will be composing some software based on this code, and making an executable out of it.&nbsp; Is registration on the end user computer then also required and is there a way to automate this process for the end user?Thanks,Don
DonRoth
2008-05-30 18:10:07 UTC
Permalink
One more question - on one computer that I am attempting to install an
.exe of my modified code, I double-clicked on the .uri file expecting
to get the registration.&nbsp; Instead I get the windows dialog message below.&nbsp; Why does one computer recognize the URI file and one does not? <img src="../../attachments/ni/170/327812/1/windows_dialog.png"> Thanks,DonMessage Edited by DonRoth on 05-30-2008 12:54 PM


windows_dialog.png:
Loading Image...
Eli_S
2008-06-02 16:10:06 UTC
Permalink
Hi Don, 1) There is no way yo access the password-protected code.2) In order to make an executable and run it on different computers, you will have to register the GRAMS_SPC.uri file on every computer that you want to run this executable on. I played around with this a little bit and this procedures turns out to be a little complicated. The program that actually registers the plugin is called usireg.exe and it installs with LabVIEW, this is the reason why you were getting that pop-up message asking you what do you with which program do you want to open that file. usireg.exe along with its associated files is located at c:\Program Files\National Instruments\shared\USI\Bin\. In order to make an executable work, COPY the whole Bin directory into another folder (where your application is) and add it to the LabVIEW project. (Right-click My Computer » Add » Folder (Autopopulating)..). When you create your EXE make sure to include this folder.As far as programmatically registering the plugin, I would use the System Exec.vi found in the Functions pallete at Connectivity » Libraries and Executables. With this VI you can programmatically register the plugin through the command line.
DonRoth
2008-06-02 16:10:08 UTC
Permalink
Thanks Eli.
I will try strategy in 2).
In terms of programmatically registering, what I really am after is to automate the process of registration using an installer once the strategy in 2) is implemented (the necessary components are included in the project).&nbsp; Then a user who gets the installer would not need to perform manual registration - it would be done automatically for them.
Thanks,
&nbsp;
Don
DonRoth
2008-06-06 14:40:07 UTC
Permalink
Hi Eli: I tried the (equivalent) approach you suggested regarding copying the whole bin directory to the application folder (SPC_folder_translator) on a computer that does not have LabVIEW. <img src="../../attachments/ni/170/329554/1/folder.png"> Then I tried to register by double-clicking on the URI file but still got the Windows dialog as shown in the previous message.&nbsp; Did you test this yourself?Thanks,DonMessage Edited by DonRoth on 06-06-2008 09:24 AM


folder.png:
Loading Image...
Eli_S
2008-06-09 16:10:09 UTC
Permalink
Don, That is expected to happen. The reason for moving those files to another computer is so that you have what is needed to REGISTER the URI. The registration process is actually the same. Having said that, if you register it manually (by double-clicking on the file) you will see the pop-up message regardless on which computer you do it. What I meant before is that in&nbsp; order to register this URI on different computers without having the user worry about it, is to have some code on your executable that PROGRAMMATICALLY register the URI (keep in mind you will always need to include the bin directory). To accomplish this, you can use System Exec.vi to send the command through the commant prompt.
DonRoth
2008-06-09 16:10:11 UTC
Permalink
Hi Eli:
Can you please provide a simple&nbsp;working code example of what you are explaining above that will allow a user who does not have LabVIEW on the machine to perform the programatic registration.
Thanks,
&nbsp;
Don
Eli_S
2008-06-10 16:40:05 UTC
Permalink
Hi Don, Please find the attached code. There is nothing on the front panel so take a look at the block diagram, which actually turned out to be pretty simple. You can incorporate this pice of code into your main program and have it run when the program launches.I am posting in LabVIEW 8.0 so you should be able to open it in 8.0 or any later version. Please let me know if you have any problems running it.


Register_uri.vi:
http://forums.ni.com/attachments/ni/170/330394/1/Register_uri.vi
DonRoth
2008-06-11 19:10:09 UTC
Permalink
Thank you Eli.&nbsp; This approach appears to have worked well on a computer in which LabVIEW is not installed.&nbsp; Thanks again.
&nbsp;
Sincerely,
&nbsp;
Don
DonRoth
2008-06-12 15:10:06 UTC
Permalink
Hi Eli - well I jumped the gun.&nbsp; I could run the executable code, however I get the following error which seems related to the storage VIs.&nbsp; Could not find anything on this on the support pages that I looked.&nbsp; Any advise and suggestions to fix are appreciated. <img src="../../attachments/ni/170/331184/1/error%20-2560.png"> Sincerely,DonMessage Edited by DonRoth on 06-12-2008 09:48 AM


error -2560.png:
http://forums.ni.com/attachments/ni/170/331184/1/error -2560.png
Eli_S
2008-06-13 23:10:05 UTC
Permalink
I think this error happens because the URI did not actually registered and I think the reason for this is because the path of usireg.exe along with the path of the URI changed&nbsp; in the new computer. Can you verify this and let me know if this is the case or not?
DonRoth
2008-06-16 14:10:07 UTC
Permalink
I tried your directions manually at first, not programmatically, on my computer that does not have LabVIEW on it. This should be the identical set of instructions that the system exec will perform. <img src="../../attachments/ni/170/331974/1/registration.png"> Message Edited by DonRoth on 06-16-2008 09:00 AM


registration.png:
Loading Image...
DonRoth
2008-06-16 16:10:07 UTC
Permalink
As another test, I then created a small executable based on your VI code, placed it into the bin directory on the computer without LabVIEW, and executed it but with the same result. Attached is the exact code used to create the executable.Thanks,Don


test41.vi:
http://forums.ni.com/attachments/ni/170/332044/1/test41.vi
Eli_S
2008-06-17 21:10:05 UTC
Permalink
Hi,


I finally got this to work! For some reason the VI that I sent you initially
(the one that registers the .uri) was working when I first made it but it
wasn't working today so I made some changes to it and it works now.

I made an executable of both the VI that registers the GRAMS_SPC.uri and the VI
that reads the file and plots the data. I moved both of these executables along
with the whole Bin folder that contains usireg.exe into a computer without
LabVIEW and I was able to run the first executable (to register) and then the
other one and I was able to plot the data.

I am attaching here a ZIP folder that contains everything I used to test. It
has both executables (already built), the source code for both, the Bin folder,
GRAMS_SPC.uri, and the data file. The executables are located under the Builds
folder. When you run the executable that registers the URI, make sure you
populate all the fields first with the correct information and then run it. For
the command field you want to type "/o" (without the quotations) or
to register the URI, or "/u" to deregister the URI.

I tested this so it should work for you as well. Remember that you need to have
the LabVIEW Run-Time Engine on the target computer.
Eli_S
2008-06-17 21:10:05 UTC
Permalink
Here are the files... I actually had to remove the Bin folder from the ZIP because it was too big and I wasn't able to post it here. If you use your own bin directory it should be OKMessage Edited by Eli_S on 06-17-2008 03:59 PM


SPC-Registration.zip:
http://forums.ni.com/attachments/ni/170/332529/1/SPC-Registration.zip
DonRoth
2008-06-18 17:40:08 UTC
Permalink
Hi Eli - can you do me a favor and try the following:
&nbsp;
1) Unzip and place in folder the SPC files in test1.zip
2) Run the top-level VI in the attached LLB
3) Verify that the SPC files translated properly to .txt files (this is easy to verify because the spectra will display in the waveform graph)
&nbsp;
4) create an executable out of the LLB files.&nbsp; Copy the SPC files to the machine that does not have LabVIEW, and run on that machine.&nbsp; Let me know if that works.
&nbsp;
Thanks,
&nbsp;
Don


test1.zip:
http://forums.ni.com/attachments/ni/170/332912/1/test1.zip


SPC_Folder_Convert_to_ASCII.llb:
http://forums.ni.com/attachments/ni/170/332912/2/SPC_Folder_Convert_to_ASCII.llb
Eli_S
2008-06-20 16:10:06 UTC
Permalink
It worked! Here is a screenshot of just one SPC file, but when I was running, a few windows popped-up. Just to confirm, the computer in which I ran the executable, DID NOT have LabVIEW installed.


Executable.JPG:
Loading Image...
DonRoth
2008-06-20 16:10:09 UTC
Permalink
Ok - what that means is that on my machine without LabVIEW, for some reason the URI file is somehow not getting registered, or the LabVIEW 8.5 rte is not on the machine.&nbsp; I believed the LabVIEW 8.5RTE to be on the machine, but when I did a search for it, I could not locate it. Then I went to install the LabVIEW 8.5 rte by including it in an
installer, it would not install it (I am supposed to have admin
privileges on my machine but will check). I then took the LabVIEW 8.5 rte file from the shared directory on a computer that does have LabVIEW 8.5, and placed it in the c:\program files\national instruments folder on the computer without LabVIEW.&nbsp; Still the SPC file translator does not work right (getting the -2560 error). Another guy is having the identical issue that I am but he definitely has the LabVIEW 8.5 RTE running on his machine because I sent him another EXE that was written in LabVIEW 8.5.&nbsp; I think what I am going to do is put this EXE on my machine and thereby make sure the LabVIEW 8.5 RTE is on there, so we can at least narrow it down to the registration issue.I'll have to revisit this sometime next week and get back with you.Sincerely,Don
Eli_S
2008-06-20 18:10:05 UTC
Permalink
This is a little strange. If you do not have the RTE installed on the computer, then the EXE should not run at all and you should get an error message specifically saying that the RTE is missing. Another point is that you cannot simply copy files from an installed location to a computer where it is not installed, you have to run an installer for the RTE to be properly installed. I quickly looked over your code and I did not see any parts in that that actually regiester the the URI, but I that might be in a sub VI and I might have overlooked it. Also remember that Bin directory that contains the usireg.exe along with all the other necessary files. You have to be sure you have this directory in the target computer that that the command you are using to register is pointing to this directory. I might have worked on my computer because I already had the USI registered (using the executable I sent you before).
DonRoth
2008-06-20 18:10:06 UTC
Permalink
I made an executable out of the registration code you sent and ran it separately instead of putting it in my code. &nbsp; So I should have been properly registered.&nbsp; I know I am pointing to the proper locations for the files, and I do have the bin directory as I posted in an earlier post.&nbsp;&nbsp; I also tried to register manually in a dos window as I mentioned earlier.&nbsp; Yes, being able to just start the EXE would&nbsp; mean that the 85RTE is on the machine somewhere. That makes sense because I created an installer for my code.&nbsp; So I think I have the 85RTE (which is maybe why it refused to install it the second time I tried to).&nbsp; So that indicates that we still have a registration problem.Can you take the code I posted and create an installer from it, and retry on another machine without LabVIEW, note the error, and then perform registration using your code, run again, and see if it will work?&nbsp; In other words, can you start from clean system and duplicate what you did?&nbsp;&nbsp; I am sorry this is taking such an effort, but something is still not right.Thanks,Don
Eli_S
2008-06-23 15:10:06 UTC
Permalink
I don't think making an installer will make a difference. I suggest you download the RTE installer from <a href="http://joule.ni.com/nidu/cds/fn/p/sb/navsRel/lang/en?q=Run+time+engine&amp;x=0&amp;y=0" target="_blank">here</a> and install it on your target machine. Then run the executable I sent you that registers the URI, which HAS to work because it is very simple and since it is using command line instructions, if it worked on my machine it has to work on yours as well as long as you have that Bin folder. Once you have registered the URI, try running your code.
DonRoth
2008-06-23 18:10:05 UTC
Permalink
I can try tomorrow but remember you said yourself - if my EXE even ran, that means the 85RTE is already somewhere present on the system. Sincerely,Don
DonRoth
2008-06-24 15:40:07 UTC
Permalink
EUREKA!&nbsp; (still can't understand why but now it works after downloading the 85RTE and running your registration code since I believed the RTE was somewhere on here already and I had repeatedly run the registration process from DOS window).Thanks for your patience and help.Sincerely,Don
Loading...