Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 23:18 25 Nov 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : RS232 problems

Author Message
Frank N. Furter
Guru

Joined: 28/05/2012
Location: Germany
Posts: 828
Posted: 02:02am 28 May 2012
Copy link to clipboard 
Print this post

Dear community,

I would like to communicate with my Dworkin DMX (http://mischakis.mi.ohost.de/start.php) over RS232.
I have to send a "P" as character and any data as bytes with 19200,8,N,2!!!
All my efforts are unsuccessfully.

I have two problems:

- Is it possible to send over RS232 with 2 stopbits?
- I traced my transmission with a nullmodem-cable and saw that all transmissions
ended with a 10 and 13 (CR+LF) but I sended no CR and LF...

My code is:

Open "COM4:19200" As #1
Schleife:
Print #1,Chr$(80);Chr$(6);Chr$(0);Chr$(255);Chr$(50);Chr$(127)
Pause 100
GoTo Schleife


Can anybody help me? Thank you very much!!!
(...excuse me for my bad english...)

 
BobD

Guru

Joined: 07/12/2011
Location: Australia
Posts: 935
Posted: 06:44am 28 May 2012
Copy link to clipboard 
Print this post

Frank, I can't help with the stop bits but I may be able to help with the CR + LF. Here is a quote from the MMBasic Language Manual from the section on the PRINT command.
A semicolon (;) at the end of the expression list will suppress the
automatic output of a carriage return/ newline at the end of a print
statement.

Make your PRINT statement end with a ; and that should fix the CR + LF problem.
Print #1,Chr$(80);Chr$(6);Chr$(0);Chr$(255);Chr$(50);Chr$(127);


Welcome to the Back Shed.
Bob
 
Frank N. Furter
Guru

Joined: 28/05/2012
Location: Germany
Posts: 828
Posted: 07:37am 28 May 2012
Copy link to clipboard 
Print this post

Hello Bob,

thank you very much for your help! I think I had it read over!
Is there another way to send these bytes with not so many Chr$()?

Does anybody has an idea for sending a second stop bit?

Greetings to all!

Frank

 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 3801
Posted: 06:08am 29 May 2012
Copy link to clipboard 
Print this post

You can change any CHR$(...) which has a printable ASCII char to "..."
so chr$(80) can be "P" and so on

I thought OPEN allowed the # stop bits to be specified. What does the manual say?

However, it's a very poor (*) receiver that REQUIRES 2 stop bits!!!!!

(*) I'm being far more polite than I wish

John
 
Frank N. Furter
Guru

Joined: 28/05/2012
Location: Germany
Posts: 828
Posted: 07:23am 29 May 2012
Copy link to clipboard 
Print this post

Hello John,

many thanks for your reply! I understand the manual so that normaly ONLY 8,N,1 can be sended...
The DMX receiver need the time of the two stop bits to send the data to the DMX devices...

Did you ever communicated with a digital measuring slide? It needs 7,E,1 with a non standard baud rate - horrible!

BUT I FOUND A SOLUTION FOR ME!

Following code works with my Dworkin DMX DMX512 receiver (Bob, thanks again):



Open "COM4:19200" As #1


Schleife:
Print #1,Chr$(80);
Pause 1
Print #1,Chr$(12); 'number of channels
Pause 1
Print #1,Chr$(0); 'channel 0 always 0
Pause 1
'*** FIRST LED-SPOT ***
' Adress 01
Print #1,Chr$(255);' R of first LED-Spot
Pause 1
Print #1,Chr$(5); ' G of first LED-Spot
Pause 1
Print #1,Chr$(5); ' B of first LED-Spot
Pause 1

'*** SECOND LED-SPOT ***
' Adress 04
Print #1,Chr$(5); ' R of second LED-Spot
Pause 1
Print #1,Chr$(255);' G of second LED-Spot
Pause 1
Print #1,Chr$(5); ' B of second LED-Spot
Pause 1

'*** THIRD LED-SPOT ***
' Adress 07
'(DIP-Switch: 11100000)
Print #1,Chr$(5); ' R of third LED-Spot
Pause 1
Print #1,Chr$(5); ' G of third LED-Spot
Pause 1
Print #1,Chr$(255);' B of third LED-Spot
Pause 1
Print #1,Chr$(0); ' MACRO of third LED-Spot
Pause 1
Print #1,Chr$(0); ' SPEED of third LED-Spot
Pause 1
Print #1,Chr$(0); ' MODE of third LED-Spot



Pause 100
GoTo Schleife


The Pause 1 command gives enough time to send the data.

Greetings and thanks to all!

Frank
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024