Digital or Serial switching to trigger events

Ihr habt eine Idee, was wir an unseren Produkten noch verbessern könnten, dann lasst es uns wissen
Antworten
G6SWJ
Beiträge: 8
Registriert: Do 6. Mär 2014, 11:22

Digital or Serial switching to trigger events

Beitrag von G6SWJ »

Hello,

Firstly your latest release of software is really exciting. (1.30d)

With more people using Arduino or Raspberry PI in their models would you consider a digital interface to trigger events. A bit like you have the nautic tabs perhaps an new digital tab!

This could simply be for example a neat way to allow PWM switching - Allow micro controlling to quickly supply PWM for x microseconds to trigger event 1
eg:

PWM 1010ms for 10ms trigger event 1 PWM 1020 for 10ms trigger event 2.

Or perhaps a serial interface to trigger events.

I'm sure you know what I am suggesting would be really neat if you could trigger 50 (or more) (why not all!) events from a Arduino/PI etc

Perhaps you could enter your own PWM pulse length for x seconds against on a mapping table against events.

I am using a 4d systems Touchscreen to Arduino Due to XBee then Xbee to Due to USMRC2 to trigger events but it seems a backward step to provide PWM for 30ms to trigger an event which could be much faster perhaps

What do you think? - I do realise that this is easy on paper and probably very difficult to implement alongside what you have already developed.

Regards
Jonathan
A USM RC2 convert and advocate:)
Benutzeravatar
BEIER-Electronic Andy
Administrator
Beiträge: 4557
Registriert: Mi 17. Dez 2008, 07:37

Re: Digital or Serial switching to trigger events

Beitrag von BEIER-Electronic Andy »

Hello Jonathan,

there is already a way to trigger all (128) functions via the serial port at X9. We use this to activate the functions with the Sound-Teacher (menu Help -> Control sound modul function with data cable).

But I think we have to make some little changes in the firmware, if you want to use this not only for testing purpose.

If you want I can explain (next week) how this works and what commands you have to send.
G6SWJ
Beiträge: 8
Registriert: Do 6. Mär 2014, 11:22

Re: Digital or Serial switching to trigger events

Beitrag von G6SWJ »

Wow!

You guys are truly remarkable in the functionality you have created!!!!!!

Yes please I would love to know the commands/baud rate etc.

I guess I could always try and read the signal at the end of the cable with a terminal program but if you could let me know the tech detail that would be stunning.

Thank you in advance

Wow
Jonathan
Benutzeravatar
BEIER-Electronic Andy
Administrator
Beiträge: 4557
Registriert: Mi 17. Dez 2008, 07:37

Re: Digital or Serial switching to trigger events

Beitrag von BEIER-Electronic Andy »

Ok, let's try...

The baud rate is 115200 8N1.

You have to send always 4 bytes to the USM-RC-2:
1. Byte: Always 170 (0xaa hex)
2. Byte: Command (4 or 5)
3. Byte: Parameter (0 - 128)
4. Byte: Value (0=off, 1=on)

The USM-RC-2 send an answer block with 128 Bytes back. The first byte is always the command number you've sent. You can ignore all other bytes.

First, you have to send once the command 4 with the parameter 1: 170 4 1 0. This disables the normal function trigger (via prop., nautic, EKMFA, inputs), because both (normal and RS232) are not possible at the same time.

At command 5, the parameter is the function number you want to switch, shown in this list (only in German at the moment):

Code: Alles auswählen

1	Zusatzsound 1			
2	Zusatzsound 2			
3	Zusatzsound 3			
4	Zusatzsound 4			
5	Zusatzsound 5			
6	Zusatzsound 6			
7	Zusatzsound 7			
8	Zusatzsound 8			
9	Zusatzsound 9			
10	Zusatzsound 10			
11	Zusatzsound 11			
12	Zusatzsound 12			
13	Zusatzsound 13			
14	Zusatzsound 14			
15	Zusatzsound 15			
16	Zusatzsound 16			
17	Zusatzsound 17			
18	Zusatzsound 18			
19	Zusatzsound 19			
20	Zusatzsound 20			
21	Zusatzsound 21			
22	Zusatzsound 22			
23	Zusatzsound 23			
24	Zusatzsound 24			
25	Zusatzsound 25			
26	Zusatzsound 26			
27	Zusatzsound 27			
28	Zusatzsound 28			
29	Zusatzsound 29			
30	Zusatzsound 30			
				
31	Ausgang 1			
32	Ausgang 2			
33	Ausgang 3			
34	Ausgang 4			
35	Ausgang 5			
36	Ausgang 6			
37	Ausgang 7			
38	Ausgang 8			
39	Ausgang 9			
40	Ausgang 10			
41	Ausgang 11			
42	Ausgang 12			
43	Ausgangs-Sequenz 1			
44	Ausgangs-Sequenz 2			
45	Lichtschalter +			
46	Lichtschalter -			
47	Standlicht			
48	Abblendlicht			
49	Fernlicht			
50	Lichthupe			
51	Nebelscheinwerfer			
52	Nebelschlusslicht			
53	Blinker links			
54	Blinker rechts			
55	Warnblinker			
56	Lok: Fahrtlicht			
57	Schiff: Vor Anker			
58	Schiff: Auf Grund			
59	Schiff: In Fahrt			
60	Schiff: Manövrierbehindert			
61	Schiff: Manövrierunfähig			
62	Schiff: Tiefgangbehindert			
63	Schiff: Schleppend			
64	Schiff: Assistierend			
65	Schiff: Fischend			
				
66	Fahrsound ein/aus			
67	Fahrsound 2 ein/aus			
68	Zufallsound ein/aus			
69	Lautstärke +			
70	Lautstärke -			
71	Gasspiel			
72	Fahrsound Drehzahländerung			
73	Software-Reset			
74	WAV-Player: Play/Stop			
75	WAV-Player: Pause			
76	WAV-Player: Titel vor			
77	WAV-Player: Titel zurück			
78	WAV-Player: Random			
				
79	Servo 1 in Position 1			
80	Servo 1 in Position 2			
81	Servo 1 in Position 3			
82	Servo 1 in Position 4			
83	Servo 2 in Position 1			
84	Servo 2 in Position 2			
85	Servo 2 in Position 3			
86	Servo 2 in Position 4			
87	Servo 1 Sequenz			
88	Servo 2 Sequenz			
89	SM-IR-16-2: Servo 1 in Position 1			
90	SM-IR-16-2: Servo 1 in Position 2			
91	SM-IR-16-2: Servo 2 in Position 1			
92	SM-IR-16-2: Servo 2 in Position 2			
93	SM-IR-16-2: Rundumlicht			
94	SM-IR-16-2: Blitzer			
95	SM-IR-16-2: Lauflicht			

96	Ausgang 13 (EXM-2)			
97	Ausgang 14 (EXM-2)			
98	Ausgang 15 (EXM-2)			
99	Ausgang 16 (EXM-2)			
100	Ausgang 17 (EXM-2)			
101	Ausgang 18 (EXM-2)			
102	Ausgang 19 (EXM-2)			
103	Ausgang 20 (EXM-2)			
104	Ausgang 21 (EXM-2)			
105	Ausgang 22 (EXM-2)			
106	Ausgangs-Sequenz 3			
107	Ausgangs-Sequenz 4			
108	Ausgangs-Sequenz 5			
109	Ausgangs-Sequenz 6			
110	Ausgangs-Sequenz 7			
111	Ausgangs-Sequenz 8			
112	Servo 3 in Position 1 (EXM-2)			
113	Servo 3 in Position 2 (EXM-2)			
114	Servo 3 in Position 3 (EXM-2)			
115	Servo 3 in Position 4 (EXM-2)			
116	Servo 4 in Position 1 (EXM-2)			
117	Servo 4 in Position 2 (EXM-2)			
118	Servo 4 in Position 3 (EXM-2)			
119	Servo 4 in Position 4 (EXM-2)			
120	Motorausgang EXM-2 links			
121	Motorausgang EXM-2 rechts			
122	Rückwärtsfahrt			
123	Bremsen			
124	Multifunktion 1			
125	Multifunktion 2			
126	Multifunktion 3			
127	Multifunktion 4			
128	Rückfahrsound deaktivieren	
Example:
If you want to switch on output 2 you have to send: 170 5 32 1. All functions are memory functions. The output 5 stays on, until you send a 170 5 32 0 to the USM-RC-2.

Restrictions in V1.30d:
- The USM-RC-2 can receive and handle only one command every 10 ms.
- After receiving a command 5 there is an artificial delay of 5 ms (flashing the blue LED) which may cause an interruption in sound output.
G6SWJ
Beiträge: 8
Registriert: Do 6. Mär 2014, 11:22

Re: Digital or Serial switching to trigger events

Beitrag von G6SWJ »

Andy,

Thank you - this looks great - I'll see if I can get it to work my end in the next few days

THANK YOU
Jonathan
Antworten