Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

HP3560 driver

Hello,
 
I made a little driver for downloading data from HP3560 dynimac signal analyzer through serial port. Everything it seem to work  except that when I want to receive complete data as in screen I receive only about half of them
Probaly some flow control or buffer problem but I try everithing
 
Does anyone use this analyzer ?
Does anyone comunicate with it ?
 
Sasa
0 Kudos
Message 1 of 12
(5,009 Views)

Hi Sasa,
Please provide more information about how your driver works.  What functions are you using?  VISA?  Are you using LabVIEW?  If so, what version and if possible, you can include a screen shot of your LabVIEW program so we can see what all is happening and possibly find the problem.  I personally do not have any experience with that particular instrument, but will still try to help you get what you need.

Chris R.
Applications Engineer
National Instruments

Chris R.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 12
(4,974 Views)
Hello Chris,
 
Thanks for reply,
 
Here I attached screen shot of my program,
As you can see in labview2.jpg I send "J" for transfering data and after that I start to receive a data (labview1) but I receive halfo f them (labview3)
 
I should receive 401 byte of data which corespond to the complete screen of 400 lines but I receive only  1327 characters and also some of them are dummy bytes equaly +1.000000E+38 which I have to remove manualy from input string.
 
I use VISA generic driver together with Labview 6.1
 
Best Regards
Download All
0 Kudos
Message 3 of 12
(4,968 Views)
Hello
One thing I noticed is that your VISA Close is not properly wired.  Your VISA session may be closing before you are needing it to.  I have attached a screen shot of an incomplete version of your program that does not use the sequence structure.  This method uses better data flow throughout the program.  I see that you have two reads in a row.  Is this something your instrument needs?  You may only need one read.  It shows you reading 20 bytes and then immediately reading 2000.  Try this sequence of commands and see if this works better for you.  I don't know if reading twice is causing you to lose data or if it may be closing the VISA session out too early.  Let me know how this goes.
 
Chris R.
 
 
 
Chris R.
Applications Engineer
National Instruments
0 Kudos
Message 4 of 12
(4,932 Views)

Hi Chris,

The device send data after question "J" and first byte indicate the size of data packet

I try your sugestion but the result are the same,

After first reading I get framing error and after second timeout error ( see attached pictures)

I can send also abstract from manual regarding to rs232 commucation if it would help if you give me email because it is 1Mb file

 

Regards

Sasa

Download All
0 Kudos
Message 5 of 12
(4,919 Views)
0 Kudos
Message 6 of 12
(4,916 Views)

Hi Sasa,

Try adding a delay after your VISA Configure Serial Port.  Framing errors are usually caused by the port not being configured properly or by trying to use VISA Writes and Reads before the port has had time to configure.  Try this (I have posted a screen shot below) and see if you get rid of the framing error and/or the other one you are getting.

Chris. R

Chris R.
Applications Engineer
National Instruments
0 Kudos
Message 7 of 12
(4,897 Views)
Hi Chris,
 
I try to delay configuring od port , it does not help
 
I simplify the reading of data to show what I get as a result ( see attached )
 
Strange thing is that when I guide VISA resource from sequence it does not work
 
When I remove sequence it does not work even the sequence does not play any role
 
 
Regards
 
Sasa
Download All
0 Kudos
Message 8 of 12
(4,897 Views)
Sasa,

I don't know if it will correct this issue you are having or not, but you need to change how you are handling the VISA Resource.  LabVIEW is a dataflow environment, and the way you place down your wires from one VI to another or from one VI to a structure like your sequence structure primarily dictates the order of execution of your program.  The way you currently have the VISA Resource wired from the property node to the sequence structure and the VISA Close effectively creates TWO parallel tasks.  This means that you have NO control as to which one executes first.  It could be the sequence structure, but it could just as likely be the VISA Close.  The only way you can control the order of parallel tasks is to introduce some timing and synchronizing scheme, which is probably overkill for your application.  All you need - at least at this stage of your programming - is a single set of operations, not a parallel set.

That being said, unless you have a really good reason to run in parallel the close of the port and the write/read from that port, you NEED to redo your code to wire the VISA resource name constant from the the last read in your sequence structure to the VISA close, as shown in the attached picture.  Once again, I'm not sure if this will correct your current issue, however if you do not do this, I can almost guarantee that your code will have other problems in the future.

Logan S.
Message 9 of 12
(4,885 Views)

Hi

I suggest not using the visa resource name to force the sequence but the error wire or both wires.

Good programming insists on determining the first error ever happening in your program and solve that.
all later errors are influenced by the first error.

 

greetings from the Netherlands
0 Kudos
Message 10 of 12
(4,842 Views)