01-24-2017 01:07 AM
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.
01-24-2017 02:51 PM
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.
06-05-2023 02:22 AM
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 #
06-05-2023 03:15 AM
@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”