08-30-2011 06:21 AM
Hi ;
I’m building application for data acquisition in my university project (pressure measurement) using external DLL library to communicating with device .
So far , I had no problem with calling function available from DLL . But when I tried to call function for read out of pressure value , unexpected error appeared , and All my ideas to solve this problem failed , and maybe some of You had similar problem in the past:
I’m using “Call Library Function” to execute function from DLL . The DLL (s30c.dll ) is a library for communication with intelligent pressure senor (KELLER
Druckmesstechnik pressure sensor with converter RS232-RS485 K-107 (modbus communication , http://www.kelleramerica.com/manuals-and-software/manuals/Comm_Protocol_Series_30_V2.2.pdf )
In general , the call convention stdcall is used for assigning the parameters to the functions (- all parameters are passed via the stack, - the parameter furthest to the right is calculated and passed first, the parameter furthest to the left is calculated and passed last, - the function itself deletes the parameters from the stack.)
I have connected and called successful function for read serial No , Configuration of pressure sensor . But when I try to call read out pressure function the unexpected faults occur.
When input parameters are being read by Call Library Function block the Labview application stops and Message box about error appears (information that unexpected error appeared and application should be restarted ).
But it is only when I use correct device address ( 255 (Byte : 8-bit without sign) also when I use Communication address ( 250 ) the application stopped. But then I write incorrect address (for example 251) the function receive RS_TIMEOUT status , when I disconnect line data to address input the function receive : BROADCAST info .
So it is mean that Call Library Function block are configured properly .
In Call Library Function we can configure type of input parameters as void type, and when a use this option for address input for 250 or 255 address , the function receive RS_TIMEOUT status.
I thought that problem is in type of address ( format 8-bit without sign ) , but for incorrect address for properly format input data function receive information (RS_TIMEOUT ) . I also thought that function has problem with pressure data receive (32 bit frame (floating poing)) but in this case function shoult receive info : “Function successfully executed; but exception error has occurred.
Im sure that application stops when input data (address) are reading by Call Library Function , but I can’t identify problem why it is stoppinng..
Have You ever used this device ( DLL driver for data acquisition ) , and had similar problems?
.For any ideas I would be very grateful.
09-06-2011 06:47 AM
Hello,
From this description I can't tell you what the problem is - please narrow the problem to 1 of those 3 areas:
- hardware malfunction
- communication problems
- dll library
To do that, test each part seperately - check hardware if it is working properly,then try to communicate with device through some other program, and check if there is no errors in the dll library
Best Regards,
Gregor Cerne
National Instruments
09-06-2011 09:01 AM
Hi;
thanks for reply.
I have resolved problem . Function specified in DLL which I'm using in application I called successfully. I had problem with only one function (reading data from device) , but I wrote (build) Vis based on communication protocol of sensor to reading data.
Best regards
09-06-2011 09:17 AM
Hello,
I'm glad that you resolved your problem. If your will encounter any more problems, feel free to ask.
Best regards,
Gregor Cerne
National Instruments
11-01-2011 05:39 AM
I do have the same Problems ... if you are using LV VISA Drivers, please place your CODE-Sample here
THANKS
03-23-2017 10:37 AM
Hi lukaszsz,
I know it's been a long time since you posted here but as I am trying to write my own Vi, could you please help me by showing it to me ?
I have been receiving an answer from the sensor with the frame described in the Communication Protocol but it is not as it should be...
Capture.jpg shows the sent and received message and Capture2.jpg shows how I built the blocks.
Thank you in advance for your answer.
Best regards,