¿ªÔÆÌåÓý

Re: Help with EZGPIB


 

On Mon, 04 Feb 2019 15:36:34 -0800, you wrote:

What happens if you run the strip program, then copy the result string
from the beginning up to the comma? In pascal, you can find the
location of the comma, and delete all the characters before it. This
ought to give you the second part of the string, which you can strip
off the beginning.

This uses standard pascal functions.

Of course, if you could read one thing at a time (NZFN, then NTDN,
etc), you could convert each item individually.

Another option would be to search the string for NZFN, then replace it
by spaces, ditto for NTDN, etc.


maybe easier to copy out to substrings.

C has a token function that automatically parses things like this, and
pascal doesn't (that I know of).

You may want to look for parsing programs, just for fun

depends on how involved you want to get with the programming.

Harvey



I am looking for help from someone experienced with EZGPIB, or possibly Pascal if any of this makes sense. I wrote a program in EZGPIB that is working well to get data from my HP4192A.?Each read of data is in the following format which is added to a buffer and, at the end of the program, stored in a file. I think the reads are tab separated but that is not the problem.?NZFN+017.78E+03,NTDN-005.38E+00,K+01.000000?To remove unwanted characters (NZFN = |Z|, NTDN = Phase, K = kHz) I used?Answer:=EZGPIB_ConvertStripToNumber(Answer);?// an EZGPIB function. Answer is a string variable?This only strips the first characters so I get?+017.78E+03,NTDN-005.38E+00,K+01.000000?I think the comma terminates the string as far as the function is concerned. I don¡¯t know how to make the function remove all unwanted characters. Does anyone know? I tried a different function three times to remove all characters. It works however I should be able to use it once with the proper formatting to do the job but
I don¡¯t know how. Any suggestions??EZGPIB_ConvertRemove('NZFN', Answer); EZGPIB_ConvertRemove('NTDN', Answer); EZGPIB_ConvertRemove('K', Answer);?The result is what I am after: +017.78E+03,-005.38E+00,+01.000000

Join [email protected] to automatically receive all group messages.