LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

serial com.

Hi NG. I am very new to labview.....
I have made a Labview program that reads bytes from the serial porrt and
converts them into a bitstream and puts the data into an array. My problem
is that Labview removes the "zeros" in the transmitted byte (for example
00100100 becomes 100100.....). I would like Labview not do this! Is there
another way of storing a reading so I can always have all of the 8 bit?

Don
0 Kudos
Message 1 of 8
(3,081 Views)
Hi, I'm very new too...
Could you send me your program?
I have no idea where to starT and how...
Please!!!!!!
At least geme me some suggestions.
Thanks...

"Don" ha scritto nel messaggio
news:b00n9m$i0s$1@eising.k-net.dk...
> Hi NG. I am very new to labview.....
> I have made a Labview program that reads bytes from the serial porrt and
> converts them into a bitstream and puts the data into an array. My problem
> is that Labview removes the "zeros" in the transmitted byte (for example
> 00100100 becomes 100100.....). I would like Labview not do this! Is there
> another way of storing a reading so I can always have all of the 8 bit?
>
> Don
>
>
0 Kudos
Message 2 of 8
(3,081 Views)
Hi Don
This may not be exactly what you want but it might get you started.

happy programming
0 Kudos
Message 3 of 8
(3,081 Views)
If you want to display leading zeros, you need to display the byte as a string. This is not unusual for other programming languages and spreadsheets, etc.
Take the following steps.
1. Read the string one byte at a time. You can use a For loop with N = string length. Use a String Subset function (on the String palette) with offset wired to the For loop iteration and length = 1.
2. Type Cast each byte as an Unsigned 8-bit integer. The Type Cast function is on the Advanced >> Data Manipulation palette.
3. Format the byte value as an 8-bit binary string with leading zeros: use the Format into String function (on the String palette) with the Format String %08b.
See the attached LabView 6.1 example.
0 Kudos
Message 4 of 8
(3,081 Views)
Sorry: in my previous example, the numeric indicators in the numeric Bytes from String array may not be big enough to display all bits in the byte. Just stretch the numeric indicator within the array to see the lower bits.
0 Kudos
Message 5 of 8
(3,081 Views)
Hello,

I'm also new to Labview and serial programming.
I had a look at

Serial Communication - Basic 2 Port Serial Write and Read

http://zone.ni.com/devzone/cda/epd/p/id/2671

I need to read data from the ECU of a turbojet
Here is the turbo
http://wrenturbines.co.uk/
Wren Turbines MW54 Mk 3 - Autostart Kit

Here is the ECU
http://www.espiell.com/soft.htm

The specification of the serial protocol is here
http://www.espiell.com/fadprot.pdf

FADEC RS232 protocol.
Hardware:
The pin out of the RJ45 connector is:
1-Ground
2- +5VDC
5- TX
7- RX
Levels are TTL. Locate the pin 1 with a ohmmeter, it is connected to the brown pin of the
servo lead. To connect to a PC it is necessary a RS232 level converter, like the MAX232
Protocol:
RS232 interface, 2400 Baud, 8 bit, no parity.
The data is organized in frames of 50 bytes, The description of each byte is (values are in
decimal):
1. First byte of frame alignment, always 252
2. Second byte of frame alignment, always 253
3 to 34: HDT text in ASCII
35 to 39: not yet used.
40: RPM (8bit) 0-255, resolution of 1000RPM, 1 measure each 0,1s
41. Servo pulse width (Low Byte)
42. Servo pulse width (High Byte)
43. Pump power (PWM) (0-255), divide by 2,55 to have percentage.
44. Value of the auxiliary analog input (0-255)
45. Relative throttle position (0-255), divide by 2,55 to have percentage.
46. Voltage of pump. Multiply by 0.06 or 0.04 (depends of fadec type) to have the right value)
47. Temperature. Multiply by 4.
48. Pressure. Only in pressure type units.
49. RPM Low Byte. Resolution 100RPM. 1 measure each 0,5s
50. RPM High Byte
The byte assignment can change in future software releases.


So I need to read 50 bytes.
I don't know how I should proceed.

Maybe using the String_to_Bytes.vi ?

What is your opinion about it ?

Best regards
0 Kudos
Message 6 of 8
(2,713 Views)

Hi everyone,

 

Sorry to unearth this topic but I find myself in this exact situation (trying to log the infos coming via RS232 from the exact same Espiell FADEC).

Does anyone have any suggestion?

 

scls19fr, did you find a way to do so?

 

 

Thanks,

 

 

Marc

0 Kudos
Message 7 of 8
(2,252 Views)
You'll have to sync before doing anything. Make sure you have the termination character disabled in the VISA Configure Serial Port. Then in loop, read two bytes and look for the 252/253 pattern. This can be a straight string compare. Once you have found the pattern, read 48 bytes. You are now synched and subsequent reads in a loop would be set for 50 bytes.

In the future, please start a new thread.
0 Kudos
Message 8 of 8
(2,243 Views)