04-29-2009 12:44 PM
status = viOpenDefaultRM(defaultRM)
status = viStatusDesc(defaultRM, status, response)
readingslist.AddItem "viOpenDefaultRM " & Hex(status) & response
'status = viOpen(defaultRM, "GPIB0::6::INSTR", 0, 0, vinstr)' working good with gpib
status = viOpen(defaultRM, "ASLR1::INSTR", 0, 0, vinstr) ' not working when using serial
Could some help me understanding why i am not able to open the COM1 port using the above visa command in visual basic. I am not having any issue when using the GPIB0, i will need to use both communication type.
I have visa32 and visatype loaded in the modules.
Joce
Solved! Go to Solution.
04-29-2009 02:16 PM
Upon trying to open resource, i am getting the below error message. ASLR1 works fine when using the MAX application but not able to access the resource in visual basic:
"Insufficient location information or the device or resource is not present in the system."
Joce
04-30-2009 07:12 AM
04-30-2009 07:23 AM
hello, i have run NI spy, and found out the call was kind of the same, at the exception that it uses mode 4 instead of 0. either case when i put 4, it still does not give me a "0" status" in visual basic
below is the call when using ni.spy
1. viOpenDefaultRM (0x0112ADA0)
Process ID: 0x00000854 Thread ID: 0x000002D4
Start Time: 07:15:41.282 Call Duration 00:00:00.046
Status: 0 (VI_SUCCESS)
2. viOpen (0x0112ADA0, "ASRL1::INSTR", 4, 0, 0x01139F08)
Process ID: 0x00000854 Thread ID: 0x000002D4
Start Time: 07:15:41.563 Call Duration 00:00:00.062
Status: 0 (VI_SUCCESS)
04-30-2009 07:31 AM
What is strange is when i run the NI spy and the code in visual basic, it return "0x00000000" for vi in the identifier instead of a number. my vi variable is declared as Dim vinstr As Long
why is this happenning?,
2. viStatusDesc (0x105828A8, 0, "Operation completed successfully.")
Process ID: 0x00000F5C Thread ID: 0x00000B7C
Start Time: 07:23:39.291 Call Duration 00:00:00.000
Status: 0 (VI_SUCCESS)
> 3. viOpen (0x105828A8, "ASLR1::INSTR", 4, 0, 0x00000000)
> Process ID: 0x00000F5C Thread ID: 0x00000B7C
> Start Time: 07:23:39.291 Call Duration 00:00:00.000
> Status: 0xBFFF0011 (VI_ERROR_RSRC_NFOUND)
Joce
04-30-2009 07:43 AM
Well, i feel so stupid, i missed spelled " ASRL1" by "ASLR1"
it is working now.
Thanks for your help
Joce