LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

PARSING

a quick search on "ini files" here yields me to lot of result that maybe can solve your problem. Or maybe I don't understand what you mean.
0 Kudos
Message 11 of 18
(2,274 Views)

No, we don't see what you mean by looking at the project you posted 08-27-2009 03:10 AM .

 

Do you read the responses to your other posts?  It seems like you're shotgunning these posts and not following up on responses, then asking the same question again.  Earlier in this post Roberto told you what RE is and how to get to it, but then you ask again.  In your post on writing scripts, I posted an example program which allows the user to select a script file, read the file, and parse it.  http://forums.ni.com/ni/board/message?board.id=180&thread.id=42623  Your response was that you were "going to lunch lolololol".  Now you are asking the same question again.

 

The text file doesn't "launch the gui".  The gui allows the operator to select a text file, opens the file, reads it line by line, parsing each line and acting on the commands.  Since the program just sees the text script file as a data file, the engineer can edit the text file and rerun the script (using the gui) without modifying the code.  Look at the sample I posted to your thread on writing scripts.

 

Please carefully read the responses to your posts and review any code we attach.  We are happy to help, but we're not here to write your program for you.  After you read the responses and review the code, reply specifically to that post.  Don't just ask the same question again in a new post without letting us know what you don't understand about the previous post.  If our post answers your question, flag it as the accepted solution.  With all the posts you have recently made, and all the responses you have gotten, only one post gave you the solution you were looking for?  None of the posts ranked kudos from you?  Do you realize that we are volunteering our time trying to help you do your job?

 

As I have suggested before, find a good C reference book, and convince your boss that it will be a good investment to send you to CVI training, or at least to spend some time working through the CVI sample programs and on line tutorial resources.

 

 

0 Kudos
Message 12 of 18
(2,268 Views)
sometimes my internet connection goes out, so then it goes to an error page. so thats y you probably the samepost twice. so then when the internet connection comes back , i post it to make sure. thats whats happening when you see two post.
0 Kudos
Message 13 of 18
(2,254 Views)

Ok this is my question, then i may understand after this .

 

i dont wont to access the the the the txt file from the gui, i want the standalone code to do everything.

 

ComWrt(comport,send_data,stringsize):

 

so basically im going to parse the numerical value which is 22 of CHILLER 22 in to the send_data?

 

 

0 Kudos
Message 14 of 18
(2,244 Views)

You probably need to do more than send the value 22 to the chiller.  You probably need to format it into a command you send the chiller.

 

For example, if the chiller command to set the temperature is "SETTEMP", you'll need to create a string something like this.

 

sprintf(send_data, "SETTEMP %d\n", temperature);

 

Then you can use ComWrt() to write send_data.

 

Do you not want a gui on your program to run a script?  Will it just be a command-line app?  Have you looked at the sample program I posted here:

 http://forums.ni.com/ni/board/message?board.id=180&thread.id=42623?  I just noticed that I put the comments "add chiller command here" in the wrong place.  I had them there before I added the error checking for the correct number of parameters.  You should add the chiller commands in the if(items == 3) block directly above where the comments are now.

 

Will you have the gui you discussed in other threads running at the same time?  Only one program at a time can access the COM port.  If your gui is running and reading the temperature from the chiller, you could run into a problem with the two programs trying to access the COM port at the same time.

0 Kudos
Message 15 of 18
(2,241 Views)

no i dont want to gui to run the script.  in my c file. I got  a standalone and the  GUI setup in the same c file. so basically in SSI test executive we are going to put our gui under the tools menu to access the gui if we want. but our text file is going to be able change the temp just as well as our gui change the temp. So im trying to get the logic gether now of how im going to do that.

 

    bytes_sent = OpenComConfig (2, "COM11", baudrate, parity, databits, stopbits, inputq, outputq);

 

    bytes_sent=ComWrt(2,"SP?\r",4);      //Varify connection to chiller.

 

im guessing im suppose to formatting the text file into my GUI , or in a standalone code.

0 Kudos
Message 16 of 18
(2,233 Views)

Darnell:

 

Most test executives (including NI's TestStand) call test functions from DLL files.  You tell them what DLL file to use and what function to call within that DLL file.  They may force you to put a wrapper on all your exported functions so all the function prototypes are the same.

 

If you want your test executive to be able to run a script file or to be able to display a panel for interactive control of the chiller, put those two features in separate functions in you DLL and export them.  You could call them RunScript() and RunChillerInteractive().

 

Do you know what your test executive needs?  What is you test executive?  Is it a commercial package or something homegrown?

 

I have attached a sample program that includes a DLL which defines and exports RunScript() and RunChillerInteractive(), and an EXE which calls them.  The EXE is just a demo with a gui to allow you to call those functions in the DLL.  It does not define function wrappers and just uses the native prototypes for the exported functions.  In the real world, wrappers are probably needed.  Look at the comments in ChillerControl_DllExports.h to get some info on how to call these functions.

 

I don't typically include executables in my posts, but I have here just to give you a quicker look at what the programs do.  Just unzip all files into the same directory, and run ChillerDemoTestExec.exe.

 

My post include two project files, one for the DLL and the other for the executable.  If you want to play with them in the debugger, you'll have to build debug versions of both of them.  Search CVI help for "debugging DLLs" for more info.

 

0 Kudos
Message 17 of 18
(2,214 Views)

I havent  Look at you code yet that you posted, but i will i just got off work. but i parse my script today in my code and i got it working, im able to set ithe temp from the txt file.so i understand it now. thanks. i just had to actually do it. i was working on to many tasks at once today. but yeah i have one more task with labwindow and im done with cvi, and im back to my normal c++ .net

 

we were just using a cvi because the old code was already done in CVI THAT SOMEONE HAD done. so we had to use cvi . but i really enjoy working with cvi , it greats the gui's pretty easy. I love that about cvi.

0 Kudos
Message 18 of 18
(2,211 Views)