Notifications
Clear all

How to measure the magnetic field component?

7 Posts
2 Users
0 Likes
10.8 K Views
(@shuanglongxie)
New Member
Joined: 13 years ago
Posts: 4
Topic starter  

Dear Sir/Madam,

I have known how to write code to read frequency data and magnetic field value using the struct "Smeasurementvalue". But is it any method to read the magnetic field component in x,y,z respectively? I know the data got from the software can do that, but now we choose not to use the software but the API your company provided? Thank you.

Best Regards,
Shuanglong Xie


   
Quote
 stb
(@stb)
Trusted Member
Joined: 14 years ago
Posts: 84
 

Please have a look at the attached document. Here you'll find most NF variables...

PGP
Homepage


   
ReplyQuote
(@shuanglongxie)
New Member
Joined: 13 years ago
Posts: 4
Topic starter  

Thank you very much!

Best Regards,
Shuanglong Xie


   
ReplyQuote
(@shuanglongxie)
New Member
Joined: 13 years ago
Posts: 4
Topic starter  

Thank Stb.
But I am still a little confused. Does the "file" in the commands fileread filewrite refer to the file that we can record in the E6x analyze software?

Here is the case. I actually connect the E62 with a motor device. When the device arrived at a certain point, I hope to measure the magnetic field intensity in x,y,z respectively and save it in txt file with the corresponding coordinator information. What am I supposed to do? Now I can only read the root mean square of the magnetic field with the help of the struct "Smeasurementvalue" and the readcmd. But this is not enough.

I appreciate your help. Thank you so much!

Best Regards,
Shuanglong Xie


   
ReplyQuote
 stb
(@stb)
Trusted Member
Joined: 14 years ago
Posts: 84
 

You have to write an application that continuously reads data from the device and calculates a RMS. Examples are provided with the Programmers Guide.

Best Regards

PGP
Homepage


   
ReplyQuote
(@shuanglongxie)
New Member
Joined: 13 years ago
Posts: 4
Topic starter  

Hi, Stb,

I have solved the previous problem. But new problem occurred.
while reading data from buffer, it would occasionally read the residual data that is from last sweep.
the code is as follow, where do I get wrong.

Cusbconnection *con = Cusbconnection::getconnection(0);
con->clearbuffer();
con->writeenvironment(SV_USBMEAS, 1);
con->writeenvironment(SV_USBSWPRST,1);
con->readenvironment(SV_STARTFREQ,startfreq);
con->clearbuffer();

while(i++<100)
{
con->readcmd(&y, UST_PHYFREQDAT,size);
con->readdata(&y, 1);

……
……;reading data and save and display.
……
}

con->writeenvironment(SV_USBMEAS, 0);

// close devices
Cusbconnection::closeall();
getch();

In most cases, it can read the right data in right order. But sometimes it may read the residual data.

any help would be greatly appreciated.

Best Regards,
Shuanglong Xie


   
ReplyQuote
 stb
(@stb)
Trusted Member
Joined: 14 years ago
Posts: 84
 

Hello shuanglongxie,

just disregard the out of bound data and try to synchronize against the start frequency.

PGP
Homepage


   
ReplyQuote
Share: