- CVI 정보나눔(www.cvi.kr)
- 스터디
- 질문답변
질문,답변
글 수 1,629
ViSession 이 Undeclared identifier라는 에러가 나온다면,
visa.h 헤더파일이 제대로 include 되지 않았나봅니다.
파일의 제일 윗부분에서 아래와 같이 라인을 추가해보시구요.
#include
visa.h 라는 텍스트 위에서 마우스 오른쪽 버튼 클릭시 나오는 팝업메뉴 중 "Open Quoted Text...(Ctrl+U)" 를 선택해서, visa.h 헤더파일이 제대로 불러지는지 확인해 보시죠.
아래의 함수에 대해 Function Panel(Ctrl+P)을 열어서 살펴본 도움말을 아래에 옮깁니다.
그럼, 좋은 하루되세요.
viOpenDefaultRM() --------------------------------------------------------------------------
Returns a session to the Default Resource Manager resource.
The Default Resource Manager is needed to open a session to any device. The Resource Manager is capable (through viFindRsrc and viFindNext) to locate all resources currently on the system.
When a Resource Manager session is passed to viClose(), not only is that session closed, but also all find lists and device sessions (which that Resource Manager session was used to create) are closed.
Prototype:
ViStatus viOpenDefaultRM (ViPSession Rsrc_Manager_Handle);
viOpen() --------------------------------------------------------------------------
The viOpen operation is used to establish communication with a remote instrument. Based on the Instrument Descriptor, the viOpen operation establishes a communication session with a device and creates an Instrument Handle that is used by all other VISA operations to perform operations on that session.
This operation applies to VISA resource manager sessions only.
Prototype:
ViStatus viOpen (ViSession Rsrc_Manager_Handle,
ViRsrc Instrument_Descriptor,
ViAccessMode Access_Mode,
ViUInt32 Open_Timeout,
ViPSession Instrument_Handle);
viSetAttribute() --------------------------------------------------------------------------
Sets a specified attribute for the given object.
Attributes have values of different data types with different valid ranges. Because of this, a list of attributes, their data types and valid values are provided in the Help for "Attribute Value."
Some attributes are not settable by the user, and are denoted as such in the Help for "Attribute Value".
This operation applies to all VISA session types.
Prototype:
ViStatus viSetAttribute (ViObject Object_Handle,
ViAttr Attribute_Name,
ViAttrState Attribute_Value);
viWrite () --------------------------------------------------------------------------
Writes data to a device. The data to be written is in the specified Buffer. This operation returns when the transfer terminates.
This operation applies to the VISA INSTR session type.
Prototype:
ViStatus viWrite (ViSession Instrument_Handle, ViBuf Buffer,
ViUInt32 Count, ViPUInt32 Return_Count);
viRead () --------------------------------------------------------------------------
Reads data from a device. The data read is stored in the specified Buffer. This operation returns when the transfer terminates.
This operation applies to the VISA INSTR session type.
Prototype:
ViStatus viRead (ViSession Instrument_Handle,
unsigned char Buffer[], ViUInt32 Count,
ViPUInt32 Return_Count);
viClose () --------------------------------------------------------------------------
Closes the specified device I/O session or resource manager session. This operation deallocates all system resources allocated to the Session Handle. The same operation is also used to close handles to other types of VISA objects.
Notice that if a resource manager session is closed, all VISA sessions opened with the corresponding resource manager session are also closed. Therefore, an application should usually close resource manager sessions only when it is about to exit.
This operation applies to all VISA object types.
Prototype:
ViStatus viClose (ViSession Session_Handle);
visa.h 헤더파일이 제대로 include 되지 않았나봅니다.
파일의 제일 윗부분에서 아래와 같이 라인을 추가해보시구요.
#include
visa.h 라는 텍스트 위에서 마우스 오른쪽 버튼 클릭시 나오는 팝업메뉴 중 "Open Quoted Text...(Ctrl+U)" 를 선택해서, visa.h 헤더파일이 제대로 불러지는지 확인해 보시죠.
아래의 함수에 대해 Function Panel(Ctrl+P)을 열어서 살펴본 도움말을 아래에 옮깁니다.
그럼, 좋은 하루되세요.
viOpenDefaultRM() --------------------------------------------------------------------------
Returns a session to the Default Resource Manager resource.
The Default Resource Manager is needed to open a session to any device. The Resource Manager is capable (through viFindRsrc and viFindNext) to locate all resources currently on the system.
When a Resource Manager session is passed to viClose(), not only is that session closed, but also all find lists and device sessions (which that Resource Manager session was used to create) are closed.
Prototype:
ViStatus viOpenDefaultRM (ViPSession Rsrc_Manager_Handle);
viOpen() --------------------------------------------------------------------------
The viOpen operation is used to establish communication with a remote instrument. Based on the Instrument Descriptor, the viOpen operation establishes a communication session with a device and creates an Instrument Handle that is used by all other VISA operations to perform operations on that session.
This operation applies to VISA resource manager sessions only.
Prototype:
ViStatus viOpen (ViSession Rsrc_Manager_Handle,
ViRsrc Instrument_Descriptor,
ViAccessMode Access_Mode,
ViUInt32 Open_Timeout,
ViPSession Instrument_Handle);
viSetAttribute() --------------------------------------------------------------------------
Sets a specified attribute for the given object.
Attributes have values of different data types with different valid ranges. Because of this, a list of attributes, their data types and valid values are provided in the Help for "Attribute Value."
Some attributes are not settable by the user, and are denoted as such in the Help for "Attribute Value".
This operation applies to all VISA session types.
Prototype:
ViStatus viSetAttribute (ViObject Object_Handle,
ViAttr Attribute_Name,
ViAttrState Attribute_Value);
viWrite () --------------------------------------------------------------------------
Writes data to a device. The data to be written is in the specified Buffer. This operation returns when the transfer terminates.
This operation applies to the VISA INSTR session type.
Prototype:
ViStatus viWrite (ViSession Instrument_Handle, ViBuf Buffer,
ViUInt32 Count, ViPUInt32 Return_Count);
viRead () --------------------------------------------------------------------------
Reads data from a device. The data read is stored in the specified Buffer. This operation returns when the transfer terminates.
This operation applies to the VISA INSTR session type.
Prototype:
ViStatus viRead (ViSession Instrument_Handle,
unsigned char Buffer[], ViUInt32 Count,
ViPUInt32 Return_Count);
viClose () --------------------------------------------------------------------------
Closes the specified device I/O session or resource manager session. This operation deallocates all system resources allocated to the Session Handle. The same operation is also used to close handles to other types of VISA objects.
Notice that if a resource manager session is closed, all VISA sessions opened with the corresponding resource manager session are also closed. Therefore, an application should usually close resource manager sessions only when it is about to exit.
This operation applies to all VISA object types.
Prototype:
ViStatus viClose (ViSession Session_Handle);
행복한 하루 되세요