01-28-2013 06:30 AM
Hello all,
I have a Sick lms 100 laser scanner connected to the Act/Link port of a CRIO 9024 and wanna get data from the Sick. i run the attached code but nth is desplayed. can anyone help plz?
Regards,
Samira
01-28-2013 06:41 AM
Hello all,
I have a Sick lms 100 laser scanner connected to the one of the 2 TCP/IP ports of a CRIO 9024 and wanna get data from the Sick. the other TCP/IP port is obvously connected to the pc.
I've written a simple program in Labview using TCP open connection, TCP read, and TCP close connecton, but no output is desplayed. What am I supposed to do? shall I install a labview driver dor Sack?
A driver came with the Sack but it is not specially for labview, I have written the ip address & port name on TCP open connection.
Regards,
samira
01-29-2013 06:57 AM
Hi, I am sorry, but with a byte count of zero you WILL read nothing.
Best way to get on top of it would be to open up the shipping TCP- examples that are coming with LabVIEW.
Just go to help --> example finder and search for "TCP". There you will find a simple server-client example which you can modify.
Furthermore you will have to check how the device is communicating, the actual protocol being used, and how the frames are supposed to be composed.
You should be able to find this information in the manual of your laser scanner.
You can test everything just on the PC and move it down to the cRIO when it works.
regards
Marco Brauner NIG
01-29-2013 08:13 AM
Hi Marco,
Thanks for the response. The attached mfile produces no outputs as well. I have a document with he scanner(attached), but does it also work with labview? or is it just to program in Sopas?(the software thet came in the scanner package).
Best wishes,
Samira
01-29-2013 08:48 AM
HI Samira,
your scanner accepts binary or ascii commands as described in chapter 2 of your PDF.
This chapter actually describes the frame-layout, and the following chapters describe the available commands.
You can send those commands with a terminal but you can also do with LabVIEW (or any other language, since it´s just strings).
best
Marco
01-29-2013 09:35 AM
Hello Marco,
thanks again. So, i'll be using the tcp blocks in labview, to send string commands(with frames) on the scanner, and eg get angles as outputs.
Best regards,
Samia
01-29-2013 09:41 AM
Hi Samira,
right, that´s what you need to do. Maybe this library can simplify your work a little bit.
http://www.ni.com/white-paper/4095/en#toc8
That´s a like "open-read-write-close"-style API around the LabVIEW-TCP/IP Functions which is even easier to use.
good luck
Marco
01-30-2013 02:25 AM
Thank u Marco. I'll inform u of the results ;D
01-30-2013 07:41 AM
Hello again,
as long as i see, in order to start the communication, i have to send a 15 byte request, from which 3 bytes define the type (variable type: string) and 12 bytes are assessed to the command (variable type: string). The answer would come in 16 bytes (3:string- 12:string- 1:Enum8).
The attached program produces no outputs. Can u please give me a hint how am i supposed to request? Shall i seperate different parts of the msges? how?
Thanks and best regards,
Samira
01-30-2013 09:42 AM
Hi Hi,
I found in an Ni document that:
LabVIEW stores strings as pointers to a structure that contains a 4-byte length value followed by a 1D array of byte integers (8-bit characters), as shown in the following illustration. If the handle, or the pointer to the structure, is NULL, LabVIEW treats the string as an empty string, which is the same as a string with length value of zero. Because LabVIEW uses the length value and not a terminating character to determine the end of the string, you can embed all characters that include the NULL character, or ASCII character 0, in the string at any point. When passing LabVIEW strings to external code that expects a C string, the embedded NULL characters cause the code to interpret the string as terminating at the first NULL character.
How shall i overcome this problem?
Best regards,
Samira