From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Yet another string communicaiton passing issue with DLLs

 

I am trying to connect to a Yasakawa Motoman MOTOCom DLL using a call library function node

 

I can read strings generated MOTOcom functions using the C String defintion

ie short BSCIsJobName(short nCid, char*jobname, short size)

where the in the paramters

return is a numeric-16 bit signed integer

ncid is a numeric-16 bit signed integer

*jobname is a string - C String Pointer

size is a numeric-16 bit signed integer

 

but writing out to the same format fails

short BSCSelectJob(short nCid, char*name)

where the in the paramters

return is a numeric-16 bit signed integer

ncid is a numeric-16 bit signed integer

*name is a string - C String Pointer

 

 

common issue: i can read and write numerics and pointers to arrays of numerics but can only read strings - not send them to the DLLs

 

i have been playing with DSNewPtr to create a pointer and MoveBlock to set it up

and trying to send the resultant pointer to the paramenter defined as INSTANCE DATA POINTER with crashing results. never makes it to DSDisposePtr....

 

I have included the DLL definitions - auto import doesnt work as it just creates C String Pointers like i did manually.

please help.

Download All
0 Kudos
Message 1 of 4
(2,452 Views)

Can you show how you're configuring the Call Library Function Node? There should be no problem getting data out of a string. Are you pre-allocating the string before you pass it to the DLL? You should make sure you initialize a string to the correct length, either by creating a string of the right length as a constant, or using "Initialize Array" to create an array of U8, then doing Byte Array to String.

0 Kudos
Message 2 of 4
(2,386 Views)

I have another question, how do you establish a connection with the robotic arm using the Motoman MOTOCom DLL? When I call the BSCOPEN function, I keep returning code -8, but it works fine in debugging software and C #

0 Kudos
Message 3 of 4
(536 Views)

@Freddy. wrote:

I have another question, how do you establish a connection with the robotic arm using the Motoman MOTOCom DLL? When I call the BSCOPEN function, I keep returning code -8, but it works fine in debugging software and C #


My magic crystal ball still doesn’t work so I can not see the VIs you did NOT attach! And please attach the actual VIs, not an image of them and if you use a newer LabVIEW version than 2020, please do first a “Save for previous version”

Rolf Kalbermatter
My Blog
0 Kudos
Message 4 of 4
(528 Views)