03-31-2020 08:01 AM
Hello.
I want to turn on/off the LED lamp with rs-232c serial communication.
However, even though I checked the serial example, I have no idea that how to control the light intensity by the serial communication.
I would like to get some ideas about rs-232c communication.
Thank you 🙂
03-31-2020 11:59 AM
What is controlling the lamp? What is the message protocol for controlling the lamp?
03-31-2020 10:28 PM
If you are just thinking of controlling a "dumb" (think IKEA lamp, or any off the shelf LED with no native control features built in) LED lamp ON/OFF using RS232 then you probably want to look into toggling a relay via RS232. But then you mention controlling the light intensity, so that suggests you want to also control the current the the LED. At this point we really need more details.
Which LED lamp? Make and model? Commands for RS232 communication would be helpful.
04-01-2020 07:43 PM
Controlling the lamp means turning it off and on.
The protocol is like below :
- 1 Byte only
- 0~255(00H~FFH) : minimum - 0(00H), maximum - 255(FFH)
04-02-2020 06:08 AM - edited 04-02-2020 06:09 AM
@GBLEE wrote:
The protocol is like below :
- 1 Byte only
- 0~255(00H~FFH) : minimum - 0(00H), maximum - 255(FFH)
Then use a U8 to control the intensity. Use Type Cast to convert it into a string and VISA Write to send the data.

04-08-2020 03:59 AM
My explanation was wrong.
Actually, I dont know much about the serial communication.
But the lamp engineer told me like this.
The protocol is :
header : 0x80 (0x means hexagonal)
start : 0x02
start : 0x02
intensity 0x00 (off), 0x38~0xFF (56~255 : 1~99.5)
close : 0x03
close : 0x03
In order to turn on the lamp,
I should send the message to the lamp
80 02 02 FF 03 03 (The 'FF' can be any hexonal number to control the intensity).
To turn off the lamp,
we can send '80 02 02 00 03 03'.
How can i send this message to the lamp by the series communication?
Thank you.
04-08-2020 04:35 AM - edited 04-08-2020 04:43 AM
try something like this?
used an event to catch a new value
the arrays and the string indicator are set to display hex(adecimal ! ) values, and the control properties are changed to show decimal and hex 🙂
adding serial error and serial configuration details is now your homework 🙂
read the help files of the vis used ..
04-08-2020 09:15 PM
Hi henrik.
Thanks for you comment.
But I cannot open you vi because its version (LV 18) is newer than mine (LV 15)
And now i'm trying to write hexadecimal number like your vi but i cannot mimic it.
Can you tell me how to send hexadecimal number?
Thank you.
04-09-2020 12:26 AM
Take some hours until I have access to my LV PC ....
Take the time to read and practise some LV Basics ... 😄
04-09-2020 01:57 AM - edited 04-09-2020 02:01 AM
here we go
if you right click on constants/control/indicators you can change the display style (ether directly for strings, or via display format ,properties)