‎02-22-2012 11:54 AM
Hi!
Thanks for your help. I was about to send this command:
REM on\r\n
and the remote switched to ON!
But I cannot turn it off with REM off\r\n in the same instance? I have to close the "communicate with device" window and re-open it to send REM off\r\n for it to turn off. Why is this?
‎02-23-2012 12:11 PM
Are you able to send any commands at all (such as a *IDN?), or are all of your commands invalid until you close and re-open the session?
Ryan
‎02-23-2012 12:12 PM
I am unable to send ANY commands until I close and reopen it.
‎02-24-2012 03:08 PM
Hi Tnguyen628,
Do you mean you are unable to send commands or the device does not respond to commands at this point? Also did you write your REM ON command using a WRITE operation or a QUERY operation? The WRITE operation sends the command without waiting for a response. The QUERY operation send the command and then waits for a response. It does not sounds like this is an issue with the USB-GPIB-HS, rather it is an issue with not sending the proper commands and getting proper responses from the device. You should consult the manual for this device and read some material to become more familiar with how GPIB communication works. Looking at page 109 of that device manual it looks like you should be receiving a reply after using the REM command in the following format: [ on | off ] <CR> <LF and EOI>.
‎02-27-2012 12:44 PM
@JD_war_eagle wrote:
Hi Tnguyen628,
Do you mean you are unable to send commands or the device does not respond to commands at this point? Also did you write your REM ON command using a WRITE operation or a QUERY operation? The WRITE operation sends the command without waiting for a response. The QUERY operation send the command and then waits for a response. It does not sounds like this is an issue with the USB-GPIB-HS, rather it is an issue with not sending the proper commands and getting proper responses from the device. You should consult the manual for this device and read some material to become more familiar with how GPIB communication works. Looking at page 109 of that device manual it looks like you should be receiving a reply after using the REM command in the following format: [ on | off ] <CR> <LF and EOI>.
I did a WRITE operation with REM on\r\n - the instrument will turn on.
But when I do REM off\r\n the instrument will NOT turn off.
I have to restart "Communicate with instrument" in order to do REM off\r\n
‎02-28-2012 11:01 AM
Hi Tnguyen628,
It states in the manual for the device that when sending the REM ON command, the device will reply with a result string. Which means after you have written this command you will need to read the data off the lines from the device. So try using a QUERY when writing the REM ON command or perform a WRITE of the REM ON command and then a READ to read the response from the instrument.
‎01-09-2013 07:19 AM
Hello,
I have the following problem:
I try to communicate through Matlab with the device (Anritsu pulse-pattern generator) using GPIB connection.
Here is the code:
ppg_addr='GPIB0::16::INSTR';
v = visa('ni',ppg_addr);
fopen(vtek);
fprintf(vtek,'*IDN?\n')
fscan(vtek);
fclose(vtek);
I have the Instr. control toolbox and the 488.2 drivers installed.
The "fopen" command sucessfully establishes communication (also, the GPIB remote led indicator lights up on the device).
However, during the execution of "fscan" (also if I replace it by "query" or "fgets") I get the timeout error.
Also using some command such as, for instance, "fprintf(vtek,'LGC 1\n')" that is supposed to set pattern logic I have the same result.
When I use the NI Visa interactive control, for the same menemonics, the communication is fine, I put these commands in viWrite and they are recognized OK by the device.
I also tried to work without \n in Matlab, but the result is the same.
Is there some configuration that Interactive control sets that I have to add in Matlab?
Any help is appreciated
Tnx
‎01-09-2013 07:25 AM
In the previous post the object name is vtek and not v 🙂
Also, some more information that might help: The get command results in:
out = get(vtek)
out =
Alias: ''
BoardIndex: 0
ByteOrder: 'littleEndian'
BytesAvailable: 0
BytesAvailableFcn: ''
BytesAvailableFcnCount: 48
BytesAvailableFcnMode: 'eosCharCode'
BytesToOutput: 0
EOIMode: 'on'
EOSCharCode: 'LF'
EOSMode: 'none'
ErrorFcn: ''
InputBufferSize: 512
Name: 'VISA-GPIB0-16'
ObjectVisibility: 'on'
OutputBufferSize: 512
OutputEmptyFcn: ''
PrimaryAddress: 16
RecordDetail: 'compact'
RecordMode: 'overwrite'
RecordName: 'record.txt'
RecordStatus: 'off'
RsrcName: 'GPIB0::16::0::INSTR'
SecondaryAddress: 0
Status: 'open'
Tag: ''
Timeout: 10
TimerFcn: ''
TimerPeriod: 1
TransferStatus: 'idle'
Type: 'visa-gpib'
UserData: []
ValuesReceived: 0
ValuesSent: 0
‎01-09-2013 09:10 AM
In the previous post the object name is vtek and not v 🙂
Also, some more information that might help: The get command results in:
out = get(vtek)
out =
Alias: ''
BoardIndex: 0
ByteOrder: 'littleEndian'
BytesAvailable: 0
BytesAvailableFcn: ''
BytesAvailableFcnCount: 48
BytesAvailableFcnMode: 'eosCharCode'
BytesToOutput: 0
EOIMode: 'on'
EOSCharCode: 'LF'
EOSMode: 'none'
ErrorFcn: ''
InputBufferSize: 512
Name: 'VISA-GPIB0-16'
ObjectVisibility: 'on'
OutputBufferSize: 512
OutputEmptyFcn: ''
PrimaryAddress: 16
RecordDetail: 'compact'
RecordMode: 'overwrite'
RecordName: 'record.txt'
RecordStatus: 'off'
RsrcName: 'GPIB0::16::0::INSTR'
SecondaryAddress: 0
Status: 'open'
Tag: ''
Timeout: 10
TimerFcn: ''
TimerPeriod: 1
TransferStatus: 'idle'
Type: 'visa-gpib'
UserData: []
ValuesReceived: 0
ValuesSent: 0
If I run from Matlab's test & measurement tool, i get: "an error occured while communicating with the instrument".
‎01-09-2013 09:29 AM
I think you need to contact Mathworks. NI's hardware and software are working just fine.