Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

how to set device as CIC using vb?

Hi, im very new at this and vb. i got a NI gpib-pcmcia card and want to communicate between devices using vb. But when i try to run my program, EHDL error occurs when sendIFC is called. and then i cant send my data through(ECIC error).
i check the property and the system controller is checked. In my prog, i even send ibrsc 1 just in case but...
I really hope someone could help me with this simple prob.
thank you. Here is my attached program.
Download All
0 Kudos
Message 1 of 10
(4,792 Views)
Hello,

I took a look at the commands you are sending and the errors you are receiving back. Specifically, I took a look at the command sendIFC, and you say that you receive error EHDL when that command is called. That particular error means that the boardID is out of range. It appears that possibly the Unit Descriptor you are passing could be incorrect.

For more information on the calls you are making and also possible errors that associated with these calls, take a looks at this help file on your computer:

C:\Program Files\National Instruments\NI-488.2\Help\GPIBHELP.chm

This file contains very helpful information on all the 488.2 calls, as well as the different errors and descriptions of those errors.

Hope this helps!

Regards,

Steven B
.
Application Engineering
National Instruments
0 Kudos
Message 2 of 10
(4,792 Views)
When i use LabView gpib initialisation. this error also occurs. but by monitoring the program it says ok and continue to complete the program execution. The main prob. in the attached sample i post is that it says that it is not CIC which i dont know why and how to make it as a CIC since i use all the commands.
0 Kudos
Message 3 of 10
(4,792 Views)
Hello,

Well, you should be able to use the ibsic command, and it should return to be CIC. Here is KB that describes why it is possible that the call would not return CIC.

http://digital.ni.com/public.nsf/websearch/1F01AC845E8D7ACE862566FA0051ECCF?OpenDocument

Also, if you continue to have trouble doing this in VB, I would recommend trying to communicate through IBIC first. There is a short tutorial on how to use IBIC at the bottom of the above linked KB.


Good luck!

Regards,
Steven B.
0 Kudos
Message 4 of 10
(4,792 Views)
thanks for your help. But i still cannot solve the EHDL error. When i use LabVIEW gpib initialisation function this error still occurs (viewed from NI spy) but from the LabVIEW block panel it says "ok".

Another problem is the visual basic sample that i attached. the send command works but i somehow cannot receive the data (EABO error). though from GPIB analyser the data is sent back to the host.
0 Kudos
Message 5 of 10
(4,792 Views)
Hello,

Unfortunately, I cannot see the program you attached at the top of this thread. It's size is 0K and if I detach the file and try to open it I get nothing. Could you attach a spy capture that shows the error so I can see what calls are being made to the driver? Here is a tutorial on SPY if you have never used it before.


http://zone.ni.com/devzone/conceptd.nsf/2d17d611efb58b22862567a9006ffe76/c31bc5fb34dbc0ef86256adf007b8a47?OpenDocument

Also, did you try to communicate through IBIC and what was the status of that?

Regards,
Steven B.

Regards,

Steven B.
Applications Engineering
National Instruments
0 Kudos
Message 6 of 10
(4,792 Views)
when i do a initialisation, from ni spy it recorded: ibfind("gpib1") then ibrsc... when it reached the ibconfig(gpib1,ibcreaddr(0x0006,1) and ibconfig(gpib1,ibcreaddr(0x0006,0) => EHDL(23) error occurs and the ud is 31001. may i know how i change the ud to a smaller value? Now i confuse between interface name, device name, board name and unit descriptor. when do i use which for initialisation?
0 Kudos
Message 7 of 10
(4,792 Views)
31001 seems like the correct number to me for a board-level UD.

Let me try to clear up your confusion:
1) Interface Name: String describing which board to use. Of the format "GPIBx", where x is 0-99. This string is passed to an ibfind call to create a session to a board.
2) Device Name: String descibing a device session. This is typically of the form "DEVx". However, these can be renamed to anything that doesn't start with "GPIB". This string is passed to an ibfind call to create a session to a device. Typically NI recommends using ibdev instead of ibfind for device level sessions (another topic).
3) Board Name: I typically think of this as the same as #1.
4) Unit Descriptor: This is the return valu
e from an ibfind or ibdev call. If you called ibfind with a board name this will be a board-level descriptor. If you called ibfind with a device name or called ibdev this will be a device-level descriptor.
5) Board Index (not on your list). This is the index of a GPIB board. This is the x (from "GPIBx") in case #1 above.

Board-level calls (ibsic, ibsre, ...) require a board-level descriptor.
Device-level calls (ibconfig (IbcREADDR), ibclr, ...) require device-level descriptors
488.2-Style calls (SendIFC, SendList, ...) require a board index.

If you pass an incorrect "handle" to any particular call you will get EHDL.

The IbcREADDR ibconfig option is good only for a device-level descriptor. Since you are using it with your board-level handle, you are getting this error. You may have been passing this handle to SendIFC (I didn't look at the original posting) and that would also return EHDL since that needs an index.
0 Kudos
Message 8 of 10
(4,792 Views)
But i use the GPIB initialisation function from LabVIEW 7 and i dont see any way i can change from board to device or vice versa. i could only wire the [id:address] to the function which i wired [1:6] and this problem pop out. May i ask how can i get rid of this error?
0 Kudos
Message 9 of 10
(4,792 Views)
I was basing my response on this being done in VB. I wouldn't worry too much about what LabVIEW is doing under the cover. LabVIEW does extra things to be more platform independent. This involves making calls that may fail on some platforms or versions of a driver. As long as the error is correctly handled (i.e., dataflow continues), you don't need to worry about it.
0 Kudos
Message 10 of 10
(4,792 Views)