Radio Data System (RDS) > MRDS1322

Development of interface software for the miniRDS in C#

<< < (2/5) > >>

SteveyD:
Jan

can you take a look at the Receive function of your example1.pas 

Procedure  TForm.Button5Click(Sender:TObject);

"if not(CheckBox1.Checked) then
begin StatusBar1.SimpleText:='Bidirectional operation not allowed';exit;end; "


IF the CheckBox1 is checked, then Bidirectional operation is allowed.
IF the CheckBox1 is not checked, then Bidirectional operation is not allowed.


Your Procedure checks the CheckBox1 and if it is checked, will continue on to receive the data.
(Bidirectional operation IS allowed, and required to complete the procedure as the code is written)

If the CheckBox1 is not checked, then you get the trap of "Bidirectional operation not allowed" with an exit. which is the exact opposite logic of what you want.


Is the trap even needed?  if so, you should change;

"if not (CheckBox1.Checked) then"


Steve








Jan:
It is surely right as it is, you cannot read any data in uni-directional mode, so -> exit.

SteveyD:
I see, Bi-directional operation is REQUIRED.

therefore the trap is correct, and the CheckBox1 must be checked.

The error is the message;

StatusBar1.SimpleText:="Bidirectional operation not allowed"

should be

StatusBar1.SimpleText:= "Bidirectional operation required"



On another note,  Which is returned in the Receive function,  TData as a byte array  or Result: Output as a string?

Jan:
You may take the example sources and modify them as required.

SteveyD:
Has anyone come up with a working example for using the Receive function in VB or C#?
I've converted and tested all the functions except Receive. Its still giving me problems.

function Receive (Adr, Len : Integer); TData; stdcall;

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Reply

Go to full version