¿ªÔÆÌåÓý

Help with EZGPIB


 

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


 

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


 

If you need to parse and filter strings, Pascal is way and above much
easier than C to use.?? C++ is different again.

As EZGPIB is Pascal based, best look up the string handling scheme on
the web.? There are LOADS of tutorials out there to show you how it's done.

It's common to need to either top/n/tail a string before conversion to a
numeric value, and there are just too many ways to do that, to list here.

As EZGPIB is in essence an interpreter, you can play with it live, with
test strings, no need to have it hooked to any hardware...

Cheers.

Dave G0WBX.

--
Created on and sent from a Unix like PC running and using free and open source software.
::


 

¿ªÔÆÌåÓý

Peter.

Try this worked example.


Program Trial3;??

Procedure ShowError();


begin? // show an exeption message

?? EZGPIB_ScreenWriteln('A "' + ExceptionToString(ExceptionType, ExceptionParam) + '" Error occured!');

end;


// Find and remove, a substring within a string.

Function Remove(SubStr:string; BodyStr:string):String;

Var SubPos, SubLen: LongInt;

Begin

????? SubPos := Pos(SubStr, BodyStr);

????? SubLen := Length(SubStr);

????? Delete(BodyStr, SubPos, SubLen);

????? result := BodyStr;

end;???


// Variables.

Var DatainStr: String;

?

Begin

?? EZGPIB_ScreenClear;? // wipe the console clean

?? DataInStr := 'NZFN+017.78E+03,NTDN-005.38E+00,K+01.000000'?? // Test Data

?? try? // run this block of code

????? EZGPIB_ScreenWriteln(DataInStr);


??? ? DataInStr := Remove('NZFN', DataInStr);

????? DataInStr := Remove('NTDN', DataInStr);

????? DataInStr := Remove('K', DataInStr);

????????

????? EZGPIB_ScreenWriteln(DataInStr);

?? except? // if(when) the above block causes an error, then..

????? ShowError;

?? end;


End.


?

The Function ¡°Remove¡± uses EZGPIB¡¯s general Procedure ¡°Delete¡±.

Try it.?? It seems safe in the event that the substring is not found too.

Dave B

?


Subject: Help with EZGPIB
From: peter bunge
Date: Mon, 04 Feb 2019 15:36:34 PST

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

-- 
Created on and sent from a Unix like PC running and using free and open source software.
::


 

¿ªÔÆÌåÓý

Sadly, I cannot help - but I am interested in an answer to this as I will probably need to do much the same in the near future.

David


On 04/02/2019 23:36, peter bunge wrote:

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


 

It's very common in string processing libraries to only replace the first instance unless a flag is passed. All the traditional Unix tools work that way as best I can recall. Does the EZGPIB documentation say anything about it?

As a wild guess, try this *exactly* as typed:

EZGPIB_ConvertRemove('(NZFN|NTDN|K)',Answer ;

This is standard regular expression syntax and if the authors of EZGPIB had any sense they used one. Henry Spencer's was always held in high regard, but there are a lot to choose from. Very likely if you add a 3rd string between the current two it will replace the first string with the 2nd string in sed(1) style.

FWIW Almost all the processing you might want to do is trivial using awk and gnuplot.


 

Thanks Harvey;

I was hoping for a simple answer such as:

Sname:=EZGPIB_ConvertStripToNumber(Sname,Sname,Sname); // where Sname is the string

Or some variation that uses commas, colons, quotes, or other punctuation. I looked through all the sample code and examples from Ulrich Bangert and found nothing (that I understood anyway). I tried some guesses and came to the conclusion that this function will not do what I want.

?

I went through all the functions and found the

?

EZGPIB_ConvertRemove(What:string;FromWhere:string);

Removes all instances of ¡°What¡± in ¡°Where¡±

?

This is the total description and a novice programmer, like me, does not really understand how to use this when there are no examples. What exactly do I put in the brackets? I tried different things until the compiler stopped complaining. I probably have it wrong even though it works.

?

I also went through a Pascal tutorial but it does not go beyond simple strings. Strings separated by commas may be regarded as an array, or more than one string. I am not a programmer and writing a page of code to replace three lines is asking for frustration.

?

So the following works

?

EZGPIB_ConvertRemove('NZFN', Answer);??? ??????????? // Answer is the string

EZGPIB_ConvertRemove('NTDN', Answer);

EZGPIB_ConvertRemove('K', Answer);

?

but with the correct punctuation it might be written as one line such as

?

EZGPIB_ConvertRemove('NZFN', Answer; 'NTDN', Answer; 'K', Answer); ?// does not work

?

Attempts at variations gave compile errors like ¡°too many variables¡±

?

My complete program is not very elegant but is easy to understand and modify, and it works.

It sets up the 4192A to display Magnitude, Phase, and Frequency. Then it starts with a frequency, and step frequency, and reads 9 times (e.g. 1kHz to 9kHz in 1kHz steps), the step frequency is increased and 9 more reads are taken (e.g. 10kHz to 90kHz in 10kHz steps), this is repeated again (e.g. 100kHz to 900kHz in 100kHz steps). If this was the last loop then 10 reads can be taken (e.g. 100kHz to 1000kHz in 100kHz steps). All reads are appended to the end of a buffer and upon completion the buffer is read to memory. Copy and paste makes variations easy so any of the units the 4192A can calculate can be read. The 4192A is quite versatile but is 1980 technology so the 7470A plotter was not yet invented and I have to work within the limitations.

The same program with slight modifications will control the HP4193A Vector Impedance Meter.

If there is no simple improvement then I will post the program to a file in a 4192A folder. Maybe an expert could re-write it to be easier to use. I cannot see how to pass variables to the EZGPIB functions and could not find suitable examples to follow.

?

This is an interim solution as I would like to move on to a C++ program that could be more interactive. Perhaps someone has already written such programs in C++.

?

My present program is this:


Program HP_4192A_Project;????????????????????? ??????????????? // LF Impedance Analyzer

// Note this is a work in progress. It acquires 3 freq decades of Z, phase, and Freq

?

?const filename= 'C:\users\user\My Documents\GPIB Prologix\HP4192A_Data.txt';

?? HP4192A???? =16;????? ?????????????????????????????????????????????????????? // LF Impedance Analyzer

?? Timeout?? =10.0;????? ?????????????????????????????????????????????????????? //

?var Answer:string;

???? i:integer;

????

begin

? ezgpib_screenclear;??????????????????????????????? ???????????????????????????????????? // Clear output console screen

? EZGPIB_ScreenWriteLn('HP 4192A Project');? ? ? ? ? ? ? ? ? ? ? ? ? // display title

? EZGPIB_fileclearbuffer;????? ??????????????????????????????????????????????????????? // clear buffer

?if EZGPIB_FileExists(Filename)then EZGPIB_fileDelete(Filename); // delete old file

? EZGPIB_BusWriteData(HP4192A,'A1B1T3F1');?? ??????????????????????????????? // Z, deg, hold/manual trig, display A/B/C

? EZGPIB_BusWriteData(HP4192A,'FR1EN');????????? ??????????????? // Spot Fequ 1 kHz

? EZGPIB_BusWriteData(HP4192A,'SF1EN');????????????? ??????????? // Step 1kHz

? EZGPIB_BusWriteData(HP4192A,'ABW0');?????????????? ?????????? // Abort Sweep, Manual Sweep

for i:=1 to 9 do

begin;

? EZGPIB_BusWriteData(HP4192A,'EX');???????????????? // Trigger

? EZGPIB_BusWaitForData(HP4192A,Answer,Timeout);??? // Get data

? EZGPIB_ConvertRemove('NZFN', Answer);?????? ??????????????? // delete NZFN

? EZGPIB_ConvertRemove('NTDN', Answer);?????? ??????????????? // delete NTDN

? EZGPIB_ConvertRemove('K', Answer);??????????????? ??????????????? ??????????????? // delete K

? EZGPIB_FileAddToBuffer(Answer);? ???????????????????????????????????? // add to buffer

? EZGPIB_ScreenWriteLn(Answer);????????????????????? ??????????????????? // Display on screen

? EZGPIB_TimeWaitForMultipleOf(1);?????????????????? ?????????????????? // Delay 1 seconds

? EZGPIB_BusWriteData(HP4192A,'W2');???????????????? ?????????????? // Step up

end;

? EZGPIB_BusWriteData(HP4192A,'SF10EN');???????????? ?????????? // Step 10kHz

for i:=1 to 9 do

begin;

? EZGPIB_BusWriteData(HP4192A,'EX');???????????????? // Trigger

? EZGPIB_BusWaitForData(HP4192A,Answer,Timeout);??? // Get data

? EZGPIB_ConvertRemove('NZFN', Answer);?????? ??????????????? // delete NZFN

??EZGPIB_ConvertRemove('NTDN', Answer);?????? ??????????????? // delete NTDN

? EZGPIB_ConvertRemove('K', Answer);??????????????? ??????????????? ??????????????? // delete K

? EZGPIB_FileAddToBuffer(Answer);??????????????????? ?????????????????? // add to buffer

? EZGPIB_ScreenWriteLn(Answer);????????????????????? ??????????????????? // Display on screen

? EZGPIB_TimeWaitForMultipleOf(1);?????????????????? ?????????????????? // Delay 1 seconds

? EZGPIB_BusWriteData(HP4192A,'W2');???????????????? ?????????????? // Step up

end;

? EZGPIB_BusWriteData(HP4192A,'SF100EN');???????????? ??????? // Step 100kHz

for i:=1 to 10 do

begin;

? EZGPIB_BusWriteData(HP4192A,'EX');???????????????? // Trigger

? EZGPIB_BusWaitForData(HP4192A,Answer,Timeout);??? // Get data

??EZGPIB_ConvertRemove('NZFN', Answer);?????? ??????????????? // delete NZFN

? EZGPIB_ConvertRemove('NTDN', Answer);?????? ??????????????? // delete NTDN

? EZGPIB_ConvertRemove('K', Answer);??????????????? ??????????????? ??????????????? // delete K

? EZGPIB_FileAddToBuffer(Answer);??????????????????? ?????????????????? // add to buffer

? EZGPIB_ScreenWriteLn(Answer);????????????????????? ??????????????????? // Display on screen

? EZGPIB_TimeWaitForMultipleOf(1);?????????????????? ?????????????????? // Delay 1 seconds

? EZGPIB_BusWriteData(HP4192A,'W2');???????????????? ?????????????? // Step up

end;

? EZGPIB_FileWrite(Filename);??????????????????????? ?????????????????????????? // write to file

end.


On Tue, Feb 5, 2019 at 12:20 AM Harvey White <madyn@...> wrote:
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
>
>





 

Thanks Reg; this was exactly the sort of suggestion I was looking for.
It needs a closing bracket to compile? ? ? EZGPIB_ConvertRemove('(NZFN|NTDN|K)',Answer);
However it does not remove any items. This is a sample from the file generated:

NZFN+011.92E+03,NTDN-022.92E+00,K+010.00000
NZFN+09.968E+03,NTDN-022.57E+00,K+020.00000
NZFN+09.241E+03,NTDN-023.56E+00,K+030.00000 // note comma separated
etc.

This is a sample using? ?? Answer:=EZGPIB_ConvertStripToNumber(Answer);? ? ? ?// strip off all ID

+017.78E+03.NTDN-005.38E+00.K+01.000000? ? // note period separated, this could cause problems

This is a sample from the file when I use the three separate lines.? ? ??EZGPIB_ConvertRemove('NZFN', Answer);
It is strange that it changes from commas separated to period separated.
I suspect that I am not using proper syntax.

+017.79E+03.-005.40E+00.+01.000000
+017.23E+03.-010.15E+00.+02.000000
+016.45E+03.-014.13E+00.+03.000000
+015.60E+03.-017.19E+00.+04.000000

On Tue, Feb 5, 2019 at 10:42 AM Reginald Beardsley via Groups.Io <pulaskite=[email protected]> wrote:
It's very common in string processing libraries to only replace the first instance unless a flag is passed.? All the traditional Unix tools work that way as best I can recall.? Does the EZGPIB documentation say anything about it?

As a wild guess, try this *exactly* as typed:

EZGPIB_ConvertRemove('(NZFN|NTDN|K)',Answer ;

This is standard regular expression syntax and if the authors of EZGPIB had any sense they used one.? Henry Spencer's was always held in high regard, but there are a lot to choose from.? Very likely if you add a 3rd string between the current two it will replace the first string with the 2nd string in sed(1) style.

FWIW Almost all the processing you might want to do is trivial using awk and gnuplot.




 

On Tue, 5 Feb 2019 09:57:45 +0000, you wrote:

If you need to parse and filter strings, Pascal is way and above much
easier than C to use.?? C++ is different again.
For the ST Micro, using TrueStudio, I use

tokenptr = strtok((char*)&WIFI.RXbuffer.data[j],delimiters);
strcpy(token[i],tokenptr);
for a snippet of code.

In pascal (first Delphi, then Lazarus), I had to write my own.

What did I miss here in Pascal (just curious, already got a parser and
so on done....)?

Feel free to reply off list.

Harvey



As EZGPIB is Pascal based, best look up the string handling scheme on
the web.? There are LOADS of tutorials out there to show you how it's done.

It's common to need to either top/n/tail a string before conversion to a
numeric value, and there are just too many ways to do that, to list here.

As EZGPIB is in essence an interpreter, you can play with it live, with
test strings, no need to have it hooked to any hardware...

Cheers.

Dave G0WBX.


 

I don't know how the commas were changed to periods.
The program is not elegant but works and should be useful without knowing anything about Pascal.
I am going to leave it alone.
This is a typical output file:
?+017.78E+03,-005.38E+00,+01.000000
+017.21E+03,-010.13E+00,+02.000000
+016.44E+03,-014.11E+00,+03.000000
+015.59E+03,-017.17E+00,+04.000000
+014.76E+03,-019.37E+00,+05.000000
+014.01E+03,-020.88E+00,+06.000000
+013.35E+03,-021.85E+00,+07.000000
+012.79E+03,-022.43E+00,+08.000000
+012.31E+03,-022.76E+00,+09.000000
+011.91E+03,-022.90E+00,+010.00000
+09.962E+03,-022.53E+00,+020.00000
+09.237E+03,-023.53E+00,+030.00000
+08.734E+03,-025.50E+00,+040.00000
+08.285E+03,-027.72E+00,+050.00000
+07.863E+03,-029.86E+00,+060.00000
+07.462E+03,-031.77E+00,+070.00000
+07.087E+03,-033.40E+00,+080.00000
+06.740E+03,-034.79E+00,+090.00000
+06.420E+03,-035.93E+00,+0100.0000
+04.441E+03,-039.26E+00,+0200.0000
+03.588E+03,-037.83E+00,+0300.0000
+03.127E+03,-035.84E+00,+0400.0000
+02.837E+03,-033.95E+00,+0500.0000
+02.636E+03,-032.24E+00,+0600.0000
+02.487E+03,-030.71E+00,+0700.0000
+02.372E+03,-029.33E+00,+0800.0000
+02.281E+03,-028.08E+00,+0900.0000
+02.207E+03,-026.93E+00,+01000.000


On Tue, Feb 5, 2019 at 12:27 PM peter bunge via Groups.Io <bunge.pjp=[email protected]> wrote:
Thanks Reg; this was exactly the sort of suggestion I was looking for.
It needs a closing bracket to compile? ? ? EZGPIB_ConvertRemove('(NZFN|NTDN|K)',Answer);
However it does not remove any items. This is a sample from the file generated:

NZFN+011.92E+03,NTDN-022.92E+00,K+010.00000
NZFN+09.968E+03,NTDN-022.57E+00,K+020.00000
NZFN+09.241E+03,NTDN-023.56E+00,K+030.00000 // note comma separated
etc.

This is a sample using? ?? Answer:=EZGPIB_ConvertStripToNumber(Answer);? ? ? ?// strip off all ID

+017.78E+03.NTDN-005.38E+00.K+01.000000? ? // note period separated, this could cause problems

This is a sample from the file when I use the three separate lines.? ? ??EZGPIB_ConvertRemove('NZFN', Answer);
It is strange that it changes from commas separated to period separated.
I suspect that I am not using proper syntax.

+017.79E+03.-005.40E+00.+01.000000
+017.23E+03.-010.15E+00.+02.000000
+016.45E+03.-014.13E+00.+03.000000
+015.60E+03.-017.19E+00.+04.000000

On Tue, Feb 5, 2019 at 10:42 AM Reginald Beardsley via Groups.Io <pulaskite=[email protected]> wrote:
It's very common in string processing libraries to only replace the first instance unless a flag is passed.? All the traditional Unix tools work that way as best I can recall.? Does the EZGPIB documentation say anything about it?

As a wild guess, try this *exactly* as typed:

EZGPIB_ConvertRemove('(NZFN|NTDN|K)',Answer ;

This is standard regular expression syntax and if the authors of EZGPIB had any sense they used one.? Henry Spencer's was always held in high regard, but there are a lot to choose from.? Very likely if you add a 3rd string between the current two it will replace the first string with the 2nd string in sed(1) style.

FWIW Almost all the processing you might want to do is trivial using awk and gnuplot.




 

On Tue, 5 Feb 2019 11:30:50 -0500, you wrote:

Thanks Harvey;

I was hoping for a simple answer such as:

Sname:=EZGPIB_ConvertStripToNumber(Sname,Sname,Sname); // where Sname is
the string
You could write it, but you'd have to do that.


Or some variation that uses commas, colons, quotes, or other punctuation. I
looked through all the sample code and examples from Ulrich Bangert and
found nothing (that I understood anyway). I tried some guesses and came to
the conclusion that this function will not do what I want.



I went through all the functions and found the



EZGPIB_ConvertRemove(What:string;FromWhere:string);

Removes all instances of ¡°What¡± in ¡°Where¡±
That's what you want.

what:string says that the first argument we call it what here, is a
string. It could also be 'this is a string', for constant strings.

FromWhere is also a string, but it can't be in quotes, since it gets
modified.

Note that this function has two, and only two arguments. You can't
just pack more arguments onto the thing, it won't work.




This is the total description and a novice programmer, like me, does not
really understand how to use this when there are no examples. What exactly
do I put in the brackets? I tried different things until the compiler
stopped complaining. I probably have it wrong even though it works.
EZGPIB_ConvertRemove('NZFN', Answer); // Answer is the
string

That's actually exactly what you should do.

You could also do:

somestring: string;

somestring := 'NZFN';

EZGPIB_ConvertRemove(somestring, Answer); // Answer is
the string

That works, too.

The advantage to this last one is that you could have a list of things
you wanted to remove (a list of strings), and just substitute that
each time.

If that doesn't make sense, just think that it's sometimes easier to
carry apples in a bag rather than one at a time.... Either, however,
works.




I also went through a Pascal tutorial but it does not go beyond simple
strings. Strings separated by commas may be regarded as an array, or more
than one string. I am not a programmer and writing a page of code to
replace three lines is asking for frustration.
Yep, and the only reason that it gets done (properly done) is if
there's a reason why those three lines need to be tweaked into
something universal...




So the following works



EZGPIB_ConvertRemove('NZFN', Answer); // Answer is the string

EZGPIB_ConvertRemove('NTDN', Answer);

EZGPIB_ConvertRemove('K', Answer);
There's the solution.



but with the correct punctuation it might be written as one line such as



EZGPIB_ConvertRemove('NZFN', Answer; 'NTDN', Answer; 'K', Answer); // does
not work
And it doesn't work because EZGPIB_ConvertRemove() takes two and only
two arguments. You don't get around that.

It's possible to write your own pascal function that does that, but
the best syntax would be something like:

EZGPIB_ConvertRemove_ALL('NZFN', 'NTDN', 'K', Answer); // will work,
but you have to write it

The procedure would be something like:

procedure EZGPIB_ConvertRemove_ALL(s1: string; s2: string; s3 string;
var string answer);
begin
EZGPIB_ConvertRemove('NZFN', Answer);
EZGPIB_ConvertRemove('NTDN', Answer);
EZGPIB_ConvertRemove('K', Answer);
end;

which effectively does pretty much what you do in the three calls.

easier to stick with what you have.



Attempts at variations gave compile errors like ¡°too many variables¡±
and now you know why.....



My complete program is not very elegant but is easy to understand and
modify, and it works.
About the only thing you might want to do is to modify it slightly to
have a procedure to call to strip the answer, or perhaps send
command/get answer/strip unwanted and save.

That comes when you start to add things, and want a slightly different
program structure that's a bit less spread out.

What you have is done just fine, though.




It sets up the 4192A to display Magnitude, Phase, and Frequency. Then it
starts with a frequency, and step frequency, and reads 9 times (e.g. 1kHz
to 9kHz in 1kHz steps), the step frequency is increased and 9 more reads
are taken (e.g. 10kHz to 90kHz in 10kHz steps), this is repeated again
(e.g. 100kHz to 900kHz in 100kHz steps). If this was the last loop then 10
reads can be taken (e.g. 100kHz to 1000kHz in 100kHz steps). All reads are
appended to the end of a buffer and upon completion the buffer is read to
memory. Copy and paste makes variations easy so any of the units the 4192A
can calculate can be read. The 4192A is quite versatile but is 1980
technology so the 7470A plotter was not yet invented and I have to work
within the limitations.

The same program with slight modifications will control the HP4193A Vector
Impedance Meter.

If there is no simple improvement then I will post the program to a file in
a 4192A folder. Maybe an expert could re-write it to be easier to use. I
cannot see how to pass variables to the EZGPIB functions and could not find
suitable examples to follow.
Generally, as in the string example, a variable of the right type can
be passed as an argument, that's just plain pascal, not EZGPIB.

However, (skipping the technical explanation for now), you can either
pass a copy to a routine (routine can change it all it wants, but the
original in the calling routine stays intact); or you can pass it a
reference to the original value, in which case, the routine changes
the original.

Reason for saying that is that the routine has to be written to do
that for you, and you can't just expect it to change stuff when
convenient. (in the little example I did above, the word "var" tells
the program to behave like that.

Perhaps this helps a bit on the passing variables to an EZGPIB
function.

If you want, we can take this offline, simply because it's starting to
deviate from EZGPIB on an HP instrument to general programming.

Harvey




This is an interim solution as I would like to move on to a C++ program
that could be more interactive. Perhaps someone has already written such
programs in C++.



My present program is this:


Program HP_4192A_Project; // LF
Impedance Analyzer

// Note this is a work in progress. It acquires 3 freq decades of Z, phase,
and Freq



const filename= 'C:\users\user\My Documents\GPIB
Prologix\HP4192A_Data.txt';

HP4192A =16;
// LF Impedance
Analyzer

Timeout =10.0;
//

var Answer:string;

i:integer;



begin

ezgpib_screenclear;
// Clear output console screen

EZGPIB_ScreenWriteLn('HP 4192A Project'); //
display title

EZGPIB_fileclearbuffer;
// clear buffer

if EZGPIB_FileExists(Filename)then EZGPIB_fileDelete(Filename); // delete
old file

EZGPIB_BusWriteData(HP4192A,'A1B1T3F1');
// Z, deg, hold/manual trig, display A/B/C

EZGPIB_BusWriteData(HP4192A,'FR1EN'); // Spot
Fequ 1 kHz

EZGPIB_BusWriteData(HP4192A,'SF1EN'); // Step
1kHz

EZGPIB_BusWriteData(HP4192A,'ABW0'); // Abort
Sweep, Manual Sweep

for i:=1 to 9 do

begin;

EZGPIB_BusWriteData(HP4192A,'EX'); // Trigger

EZGPIB_BusWaitForData(HP4192A,Answer,Timeout); // Get data

EZGPIB_ConvertRemove('NZFN', Answer); // delete NZFN

EZGPIB_ConvertRemove('NTDN', Answer); // delete NTDN

EZGPIB_ConvertRemove('K', Answer);
// delete K

EZGPIB_FileAddToBuffer(Answer); //
add to buffer

EZGPIB_ScreenWriteLn(Answer); //
Display on screen

EZGPIB_TimeWaitForMultipleOf(1); //
Delay 1 seconds

EZGPIB_BusWriteData(HP4192A,'W2'); // Step
up

end;

EZGPIB_BusWriteData(HP4192A,'SF10EN'); // Step
10kHz

for i:=1 to 9 do

begin;

EZGPIB_BusWriteData(HP4192A,'EX'); // Trigger

EZGPIB_BusWaitForData(HP4192A,Answer,Timeout); // Get data

EZGPIB_ConvertRemove('NZFN', Answer); // delete NZFN

EZGPIB_ConvertRemove('NTDN', Answer); // delete NTDN

EZGPIB_ConvertRemove('K', Answer);
// delete K

EZGPIB_FileAddToBuffer(Answer); //
add to buffer

EZGPIB_ScreenWriteLn(Answer); //
Display on screen

EZGPIB_TimeWaitForMultipleOf(1); //
Delay 1 seconds

EZGPIB_BusWriteData(HP4192A,'W2'); // Step
up

end;

EZGPIB_BusWriteData(HP4192A,'SF100EN'); // Step 100kHz

for i:=1 to 10 do

begin;

EZGPIB_BusWriteData(HP4192A,'EX'); // Trigger

EZGPIB_BusWaitForData(HP4192A,Answer,Timeout); // Get data

EZGPIB_ConvertRemove('NZFN', Answer); // delete NZFN

EZGPIB_ConvertRemove('NTDN', Answer); // delete NTDN

EZGPIB_ConvertRemove('K', Answer);
// delete K

EZGPIB_FileAddToBuffer(Answer); //
add to buffer

EZGPIB_ScreenWriteLn(Answer); //
Display on screen

EZGPIB_TimeWaitForMultipleOf(1); //
Delay 1 seconds

EZGPIB_BusWriteData(HP4192A,'W2'); // Step
up

end;

EZGPIB_FileWrite(Filename);
// write to file

end.

On Tue, Feb 5, 2019 at 12:20 AM Harvey White <madyn@...> wrote:

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





 

Thanks Harvey, I will keep this last reply online for anyone that wants to control one of these impedance meters/analyzers with EZGPIB.
I just made some runs with a Chinese Test Fixture which pointed out how many things may need to be changed in the program. There are Series and Parallel modes on the 4192A and the characters that need to be stripped will change. There are several options on what is to be measured such as |Z|, R, L, C for the A display and even more for the B display. Then there are many buttons and features that can be selected. If you don't have one, or at least the manual open, it will be confusing.
I wound up with several programs to do different things. I have the HPIB Interface instructions from the manual (pages 3-68 to 3-77 in mine) beside me to refer to the tables. I added a buffer flush because I found that repeated runs kept adding to the buffer from the previous run. Each different run needed some tweeking of the program..
A general interactive program may be possible but not practical. I will add comments before lines that may need to be changed.
I would like to hear offline from anyone with a 4192A or 4193A so we can try things together and compare notes.
PeterB

On Wed, Feb 6, 2019 at 11:34 AM Harvey White <madyn@...> wrote:
On Tue, 5 Feb 2019 11:30:50 -0500, you wrote:

>Thanks Harvey;
>
>I was hoping for a simple answer such as:
>
>Sname:=EZGPIB_ConvertStripToNumber(Sname,Sname,Sname); // where Sname is
>the string

You could write it, but you'd have to do that.

>
>Or some variation that uses commas, colons, quotes, or other punctuation. I
>looked through all the sample code and examples from Ulrich Bangert and
>found nothing (that I understood anyway). I tried some guesses and came to
>the conclusion that this function will not do what I want.
>
>
>
>I went through all the functions and found the
>
>
>
>EZGPIB_ConvertRemove(What:string;FromWhere:string);
>
>Removes all instances of ¡°What¡± in ¡°Where¡±

That's what you want.

what:string says that the first argument we call it what here, is a
string.? It could also be 'this is a string', for constant strings.

FromWhere is also a string, but it can't be in quotes, since it gets
modified.

Note that this function has two, and only two arguments.? You can't
just pack more arguments onto the thing, it won't work.

>
>
>
>This is the total description and a novice programmer, like me, does not
>really understand how to use this when there are no examples. What exactly
>do I put in the brackets? I tried different things until the compiler
>stopped complaining. I probably have it wrong even though it works.
>

EZGPIB_ConvertRemove('NZFN', Answer);? ? ? ? ? ? ? ? // Answer is the
string

That's actually exactly what you should do.

You could also do:

somestring:? ? ? ? ? ? ?string;

somestring := 'NZFN';

EZGPIB_ConvertRemove(somestring, Answer);? ? ? ? ? ? ? ? // Answer is
the string

That works, too.

The advantage to this last one is that you could have a list of things
you wanted to remove (a list of strings), and just substitute that
each time.

If that doesn't make sense, just think that it's sometimes easier to
carry apples in a bag rather than one at a time....? Either, however,
works.


>
>
>I also went through a Pascal tutorial but it does not go beyond simple
>strings. Strings separated by commas may be regarded as an array, or more
>than one string. I am not a programmer and writing a page of code to
>replace three lines is asking for frustration.

Yep, and the only reason that it gets done (properly done) is if
there's a reason why those three lines need to be tweaked into
something universal...

>
>
>
>So the following works
>
>
>
>EZGPIB_ConvertRemove('NZFN', Answer);? ? ? ? ? ? ? ? // Answer is the string
>
>EZGPIB_ConvertRemove('NTDN', Answer);
>
>EZGPIB_ConvertRemove('K', Answer);
>

There's the solution.

>
>
>but with the correct punctuation it might be written as one line such as
>
>
>
>EZGPIB_ConvertRemove('NZFN', Answer; 'NTDN', Answer; 'K', Answer);? // does
>not work
>

And it doesn't work because EZGPIB_ConvertRemove() takes two and only
two arguments.? You don't get around that.

It's possible to write your own pascal function that does that, but
the best syntax would be something like:

EZGPIB_ConvertRemove_ALL('NZFN', 'NTDN', 'K', Answer);? // will work,
but you have to write it

The procedure would be something like:

procedure EZGPIB_ConvertRemove_ALL(s1: string; s2: string; s3 string;
var string answer);
begin
? ? ? ? EZGPIB_ConvertRemove('NZFN',? Answer);
? ? ? ? EZGPIB_ConvertRemove('NTDN',? Answer);
? ? ? ? EZGPIB_ConvertRemove('K', Answer);
end;

which effectively does pretty much what you do in the three calls.

easier to stick with what you have.

>
>
>Attempts at variations gave compile errors like ¡°too many variables¡±
>

and now you know why.....

>
>
>My complete program is not very elegant but is easy to understand and
>modify, and it works.

About the only thing you might want to do is to modify it slightly to
have a procedure to call to strip the answer, or perhaps send
command/get answer/strip unwanted and save.

That comes when you start to add things, and want a slightly different
program structure that's a bit less spread out.

What you have is done just fine, though.?



>
>It sets up the 4192A to display Magnitude, Phase, and Frequency. Then it
>starts with a frequency, and step frequency, and reads 9 times (e.g. 1kHz
>to 9kHz in 1kHz steps), the step frequency is increased and 9 more reads
>are taken (e.g. 10kHz to 90kHz in 10kHz steps), this is repeated again
>(e.g. 100kHz to 900kHz in 100kHz steps). If this was the last loop then 10
>reads can be taken (e.g. 100kHz to 1000kHz in 100kHz steps). All reads are
>appended to the end of a buffer and upon completion the buffer is read to
>memory. Copy and paste makes variations easy so any of the units the 4192A
>can calculate can be read. The 4192A is quite versatile but is 1980
>technology so the 7470A plotter was not yet invented and I have to work
>within the limitations.
>
>The same program with slight modifications will control the HP4193A Vector
>Impedance Meter.
>
>If there is no simple improvement then I will post the program to a file in
>a 4192A folder. Maybe an expert could re-write it to be easier to use. I
>cannot see how to pass variables to the EZGPIB functions and could not find
>suitable examples to follow.

Generally, as in the string example, a variable of the right type can
be passed as an argument, that's just plain pascal, not EZGPIB.

However, (skipping the technical explanation for now), you can either
pass a copy to a routine (routine can change it all it wants, but the
original in the calling routine stays intact); or you can pass it a
reference to the original value, in which case, the routine changes
the original.

Reason for saying that is that the routine has to be written to do
that for you, and you can't just expect it to change stuff when
convenient.? (in the little example I did above, the word "var" tells
the program to behave like that.

Perhaps this helps a bit on the passing variables to an EZGPIB
function.

If you want, we can take this offline, simply because it's starting to
deviate from EZGPIB on an HP instrument to general programming.

Harvey

>
>
>
>This is an interim solution as I would like to move on to a C++ program
>that could be more interactive. Perhaps someone has already written such
>programs in C++.
>
>
>
>My present program is this:
>
>
>Program HP_4192A_Project;? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? // LF
>Impedance Analyzer
>
>// Note this is a work in progress. It acquires 3 freq decades of Z, phase,
>and Freq
>
>
>
> const filename= 'C:\users\user\My Documents\GPIB
>Prologix\HP4192A_Data.txt';
>
>? ?HP4192A? ? ?=16;
>? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?// LF Impedance
>Analyzer
>
>? ?Timeout? ?=10.0;
>? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?//
>
> var Answer:string;
>
>? ? ?i:integer;
>
>
>
>begin
>
>? ezgpib_screenclear;
>? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?// Clear output console screen
>
>? EZGPIB_ScreenWriteLn('HP 4192A Project');? ? ? ? ? ? ? ? ? ? ? ? ? //
>display title
>
>? EZGPIB_fileclearbuffer;
>? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? // clear buffer
>
> if EZGPIB_FileExists(Filename)then EZGPIB_fileDelete(Filename); // delete
>old file
>
>? EZGPIB_BusWriteData(HP4192A,'A1B1T3F1');
>? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? // Z, deg, hold/manual trig, display A/B/C
>
>? EZGPIB_BusWriteData(HP4192A,'FR1EN');? ? ? ? ? ? ? ? ? ? ? ? ? // Spot
>Fequ 1 kHz
>
>? EZGPIB_BusWriteData(HP4192A,'SF1EN');? ? ? ? ? ? ? ? ? ? ? ? ? // Step
>1kHz
>
>? EZGPIB_BusWriteData(HP4192A,'ABW0');? ? ? ? ? ? ? ? ? ? ? ? ? // Abort
>Sweep, Manual Sweep
>
>for i:=1 to 9 do
>
>begin;
>
>? EZGPIB_BusWriteData(HP4192A,'EX');? ? ? ? ? ? ? ? ?// Trigger
>
>? EZGPIB_BusWaitForData(HP4192A,Answer,Timeout);? ? // Get data
>
>? EZGPIB_ConvertRemove('NZFN', Answer);? ? ? ? ? ? ? ? ? ? ? ?// delete NZFN
>
>? EZGPIB_ConvertRemove('NTDN', Answer);? ? ? ? ? ? ? ? ? ? ? ?// delete NTDN
>
>? EZGPIB_ConvertRemove('K', Answer);
>? ? ? ? ? ? ? ? // delete K
>
>? EZGPIB_FileAddToBuffer(Answer);? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?//
>add to buffer
>
>? EZGPIB_ScreenWriteLn(Answer);? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? //
>Display on screen
>
>? EZGPIB_TimeWaitForMultipleOf(1);? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? //
>Delay 1 seconds
>
>? EZGPIB_BusWriteData(HP4192A,'W2');? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? // Step
>up
>
>end;
>
>? EZGPIB_BusWriteData(HP4192A,'SF10EN');? ? ? ? ? ? ? ? ? ? ? ? // Step
>10kHz
>
>for i:=1 to 9 do
>
>begin;
>
>? EZGPIB_BusWriteData(HP4192A,'EX');? ? ? ? ? ? ? ? ?// Trigger
>
>? EZGPIB_BusWaitForData(HP4192A,Answer,Timeout);? ? // Get data
>
>? EZGPIB_ConvertRemove('NZFN', Answer);? ? ? ? ? ? ? ? ? ? ? ?// delete NZFN
>
>? EZGPIB_ConvertRemove('NTDN', Answer);? ? ? ? ? ? ? ? ? ? ? ?// delete NTDN
>
>? EZGPIB_ConvertRemove('K', Answer);
>? ? ? ? ? ? ? ? // delete K
>
>? EZGPIB_FileAddToBuffer(Answer);? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?//
>add to buffer
>
>? EZGPIB_ScreenWriteLn(Answer);? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? //
>Display on screen
>
>? EZGPIB_TimeWaitForMultipleOf(1);? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? //
>Delay 1 seconds
>
>? EZGPIB_BusWriteData(HP4192A,'W2');? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? // Step
>up
>
>end;
>
>? EZGPIB_BusWriteData(HP4192A,'SF100EN');? ? ? ? ? ? ? ? ? ? ?// Step 100kHz
>
>for i:=1 to 10 do
>
>begin;
>
>? EZGPIB_BusWriteData(HP4192A,'EX');? ? ? ? ? ? ? ? ?// Trigger
>
>? EZGPIB_BusWaitForData(HP4192A,Answer,Timeout);? ? // Get data
>
>? EZGPIB_ConvertRemove('NZFN', Answer);? ? ? ? ? ? ? ? ? ? ? ?// delete NZFN
>
>? EZGPIB_ConvertRemove('NTDN', Answer);? ? ? ? ? ? ? ? ? ? ? ?// delete NTDN
>
>? EZGPIB_ConvertRemove('K', Answer);
>? ? ? ? ? ? ? ? // delete K
>
>? EZGPIB_FileAddToBuffer(Answer);? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?//
>add to buffer
>
>? EZGPIB_ScreenWriteLn(Answer);? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? //
>Display on screen
>
>? EZGPIB_TimeWaitForMultipleOf(1);? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? //
>Delay 1 seconds
>
>? EZGPIB_BusWriteData(HP4192A,'W2');? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? // Step
>up
>
>end;
>
>? EZGPIB_FileWrite(Filename);
>? ? ? ? ? ? ? ? ? ? ? ? ? ?// write to file
>
>end.
>
>On Tue, Feb 5, 2019 at 12:20 AM Harvey White <madyn@...> wrote:
>
>> 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
>> >
>> >
>>
>>
>>
>>
>>
>
>