Current Position:Home > Strange problem of calling library function node in labview 2010 and 2011

Strange problem of calling library function node in labview 2010 and 2011

Update:12-10Source: network consolidation
Advertisement
one year ago,I develop a program to usb device data and it works well,in labview 8.6 or 2009(win xp).Recently, When I test
the program in labview 2010 and labview 2011(win xp).,the program always crash immediately.I check the program and find main
problem is in call library function node. In my program,I use labview 2009 library for the USBExpress driver for
Silicon Labs USB MCU's from:https://decibel.ni.com/content/docs/DOC-9522,for example, 2 functions SI_OPEN and SI_READ
can not work well.
the header definition of SI_OPEN and SI_READ is:
SI_STATUS WINAPI SI_Open(
DWORD dwDevice,
HANDLE* cyHandle
SI_STATUS WINAPI SI_Read(
HANDLE cyHandle,
LPVOID lpBuffer,
DWORD dwBytesToRead,
LPDWORD lpdwBytesReturned,
OVERLAPPED* o = NULL
the SI_STATUS is equivalent to int type.
orignally, for HANDLE * in SI_Open, the parameter type in call library function node is numeric, data format is unsigned 32 bit integer ,and pass pointer to value.
for HANDLE in SI_Read, the parameter type in call library function node is numeric, data format is unsigned 32 bit integer ,and pass value.The program works well in labview 8.6&2009,however,crash in labview 2010 &2011.
later,I debug the program, for HANDLE *, I choose parameter type in call library function node as adapt to type, data format is point to Handles.for HANDLE, I choose parameter type in call library function node as adapt to type, data format is Handles by Value.Crash not happend in labview 2010&2011,however,it cannot read any data from from USB device correctly as before.I can not find the reason.
Dear friends,I need your help to answer the problem. Thank you.

The Best Answer

Advertisement
Based on the help page it looks like it should execute asynchronously.
The thing in the description that leads me to believe they execute asynchronously is that you can configure the library to run as a multi-threaded operation.
Please take a look here to see the difference between synchronous and asynchronous execution.
Since the code even has the ability to be multi-threaded, you can consider it as running in parallel to your other code.
Any data returned is passed to the thread that called that function.
Cory K
  • Strange problem of calling library function node in labview 2010 and 2011 Update:12-10

    one year ago,I develop a program to usb device data and it works well,in labview 8.6 or 2009(win xp).Recently, When I test the program in labview 2010 and labview 2011(win xp).,the program always crash immediately.I check the program and find main pr

  • Window doesn't close wheh Call Library Function Node set to Run in Any Thread Update:10-11

    This is a problem regarding Call Library Function Nodes running in the UI thread or any thread. I have a camera which has its own API supplied as a dll. I have created a set of VI wrappers which each call a function in the dll through a Call Library

  • Problem in call library function Update:10-11

    Hi, I encountered some problems when using call library function node. After i select the path in configuration of call library function node, an error message is shown as 1st attachment. After i tick and the specified path on diagram, link the path

  • Call a special function in the dll using Call Library Function Node???? Update:11-30

    Dear all,       I am calling a special function in the dll using call library function node. There is a input parameter that it is a enum type in this function. I don't know how to deal this parameter for calling this function.Has anybody solved this