LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabView 6.1 crashes when function in dll is called using call library function

Hi Rolf,

The size of the individual VIs are correct. Please see the details below.

I mentioned in my earlier reply... your suggestion works.. I am now trying to implement extracting array subsets.. If possible, please post the extract array vi in version 6.1.

MANY, MANY THANKS!
You made my day..
Regards,
Mim


// Size of strings including null terminator
//
#define WV_MAX_PARAMETERS_PER_BED 256
#define WV_PATIENT_NAME_SIZE 26
#define WV_PATIENT_ID_SIZE 20
#define WV_BED_LABEL_SIZE 20
#define WV_CARE_UNIT_SIZE 20
#define WV_FILE_NAME_SIZE 20
#define WV_IP_ADDRESS_SIZE 20
#define WV_MULTICAST_IP_SIZE 20
#define WV_DEVICE_TYPE_SIZE 20
#define WV_DEVICE_STATUS_SIZE 4

typedef struct {
TCHAR PatientName [WV_PATIENT_NAME_SIZE] ;
TCHAR PatientID [WV_PATIENT_ID_SIZE] ;
TCHAR BedLabel [WV_BED_LABEL_SIZE];
TCHAR CareUnit [WV_CARE_UNIT_SIZE];
TCHAR FileName [WV_FILE_NAME_SIZE];
TCHAR IPAddress [WV_IP_ADDRESS_SIZE];
TCHAR MulticastIP [WV_MULTICAST_IP_SIZE];
TCHAR DeviceType [WV_DEVICE_TYPE_SIZE];
WV_OPERATING_MODE DeviceStatus ;
WV_CONNECT_ID ConnectID ; // 0 if not connected
} WV_BED_DESCRIPTION ;


typedef struct {
WV_BED_DESCRIPTION WvBeds[WV_MAX_BEDS_PER_SERVER] ;
} WV_BED_LIST ;



/////////////////////////////////////////////////////////////////////////////////////////
//
// WvListBeds -- Fills in a list of beds that are currently online at the WinView server application
//
// Parameters:
//
// pServerName -- must contain the host name or IP address of the machine running the WinView server application
// pUserName -- must contain the user name for an authorized NT user account on the machine running the WinView server application
// pPassword -- must contain the password for an authorized NT user account on the machine running the WinView server application
// pBedList -- must point to a WV_BED_LIST structure that this routine will fill in
// pNumberOfBeds -- must point to an int that this routine will set to the number of beds currently online at the WinView server application
//
// Example:
//
// WV_BED_LIST BedList ;
// int NumberOfBeds ;
//
// int ReturnCode = WvListBeds("129.73.42.112", "guest", "winview", &BedList, &NumberOfBeds) ;
//
IMPORT_FUNCTION int WINAPI WvListBeds(const TCHAR *pServerName, const TCHAR *pUserName, const TCHAR *pPassword, WV_BED_LIST *pBedList, int *pNumberOfBeds) ;
//
/////////////////////////////////////////////////////////////////////////////////////////
0 Kudos
Message 11 of 17
(1,264 Views)
Hi John,
Thanks for your help.

Rolf suggestion worked.. You may have seen my posts.

I sincerely appreciate your time and help.

Regards,
Mim
0 Kudos
Message 12 of 17
(1,262 Views)
Here it is

Rolf Kalbermatter
Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
Message 13 of 17
(1,082 Views)
Hi Rolf,
Many thanks for posting the VI.
No crashes with my applications.. except the bed list extraction isn't OK.. Records 0, 33 and 66 are correctly extracted and the rest are messed up. I am trying to resolve the problem.

I have attached bed list obtained from our network for your review. When I wire that into your VI.. data is not extracted correctly.

I will let you know when I resolve the problem...

Thank You for all your help.

I so much appreciate it.

Regards,
Mim
0 Kudos
Message 14 of 17
(1,074 Views)
Hi Rolf,
I am attaching a modified version of your extract zero terminated VI that reads the bed list data from excel spreadsheet.

Any ideas of why bed record 0, 33 and 66 are ok but the rest are messed up?

Thank You for helping me,
Mimansa
0 Kudos
Message 15 of 17
(1,073 Views)
Considering that there seem to be always 33 records in between I would expect a problem with some of the lengths of the last two members of the list. I assumed them to be 4 bytes each which would create a recordsize of 174 bytes (I assumed wrongly 164 in the example).
Here you will have to somewhat experiment, basically what we would did now was indexing into 33 * 164 = 5412 = 2 * 2 * 3 * 11 * 41. From my original assumption it should be 174 instead but I don't get a complete match as 5412 is not exactly dividable by 174. What could be the case is that the 33th record isn't exactly at the right position but you do get at least some useful text info although only partly. Try with the record size 174 instead of 164 and see if there is a pattern. If it still doesn,t match completely try with one byte less until it matches.

Rolf Kalbermatter
Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 16 of 17
(1,067 Views)
Hi Rolf,
Thanks for your reply.

I did put the total size for each bed as 174.. Per the specs of the parameters.. I am sure it adds up to that. But for some reason, size is 174 + 24... When I add add 24 to bed size... VOILA.. it works..

Thank you so much.

This works correctly and everytime.. 🙂

Regards,
Mimansa
0 Kudos
Message 17 of 17
(1,060 Views)