Controlling an external device

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10127
Joined: Fri Feb 19, 2010 10:17 am

Re: Controlling an external device

Post by richmond62 » Wed Mar 18, 2015 7:39 pm

Obviously THIS is a log-standing sore-point:

"In terms of explicitly talking to a USB device, everyone who asks is told to
use the "open driver" command; but followup questions about what to pass to
it - ie the driverName - appear to have gone unanswered."

http://metacard.runrev.narkive.com/wNgc ... sb-devices

2003 !!!!

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10127
Joined: Fri Feb 19, 2010 10:17 am

Re: Controlling an external device

Post by richmond62 » Wed Mar 18, 2015 7:50 pm

If the driver does not exist, the result function is set to "Can't open that file." On OS X and Unix systems, you can obtain a list of available devices by reading the file "/dev/tty".

Really? How does one do that?
tty.png

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10127
Joined: Fri Feb 19, 2010 10:17 am

Re: Controlling an external device

Post by richmond62 » Sun Mar 22, 2015 6:26 pm

Well . . .

I have "the program identifier string to establish connection to the API" and it is:

"SilvaElm.R2CommandInterface.R2Command"

and the PDF I have gives examples of VB and C#:

VB: Set objApp = CreateObject("SilvaElm.R2CommandInterface.R2Command")

C#: IR2Command m_r2Command = null;
Type type = Type.GetTypeFromProgID("SilvaElm.R2CommandInterface.R2Command");
m_r2Command = Activator.CreateInstance(type, true) as IR2Command;

My PROBLEM is how to establish the connection using LiveCode.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10127
Joined: Fri Feb 19, 2010 10:17 am

Re: Controlling an external device

Post by richmond62 » Wed Apr 01, 2015 5:18 pm

So, the Roamer arrived and I jacked it into the Macintosh and got this:
RoamerComplete.png
Which is very jazzy indeed.

BUT how can I use that info to find how to perform and "open . . . to write" ?

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10127
Joined: Fri Feb 19, 2010 10:17 am

Re: Controlling an external device

Post by richmond62 » Thu Apr 09, 2015 5:57 pm

CaptureX.PNG
getting nowhere at all, and not for lack of trying.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10127
Joined: Fri Feb 19, 2010 10:17 am

Re: Controlling an external device

Post by richmond62 » Thu Apr 09, 2015 8:35 pm

Just found this: http://www.runrev.com/pipermail/use-liv ... 72471.html

"On Windows 7 :-
Using USB - RS232 adapter and/or BLUETOOTH/USB - RS232 adapter

My Serial RS232 Script works on Version 3.5.0
Sarah Reichelt's Serial Test script works on Version 3.5.0

My Serial RS232 Script fails to receive on Version 4.6.4
Sarah Reichelt's Serial Test script fails to receive on Version 4.6.4"

I intend to install Runtime Revolution 4.0 on my Windows 7 box tomorrow.

If that works then RunRev have got some very funny questions to answer.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10127
Joined: Fri Feb 19, 2010 10:17 am

Re: Controlling an external device

Post by richmond62 » Fri Apr 10, 2015 12:17 pm

I went and installed Runtime Revolution 4.0 on my Windows 7 box and then made the same
stack that I had made in LiveCode 7.0 in 4.0 with an identical script in the single button.

The picture says quite a lot:
CC4_7.PNG
RR 4.0 on the left, LC 7.0 on the right.
This would seem to indicate something has been broken and never repaired.

Sarah's 'Serial.rev" was able to SEND to the COMx: ports on the Windows box under RR 4.0, it was quite unable to under LC 7.0.

capellan
Posts: 654
Joined: Wed Aug 15, 2007 11:09 pm

Re: Controlling an external device

Post by capellan » Fri Apr 10, 2015 5:38 pm

Hi Richmond,

Did you try older versions of Revolution (1.0 to 3.5)
and MetaCard (2.x to 2.5) to test this code?

Al

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10127
Joined: Fri Feb 19, 2010 10:17 am

Re: Controlling an external device

Post by richmond62 » Fri Apr 10, 2015 7:21 pm

Not yet :)

Tomorrow, as the weather is lovely, I'll be up the hill in our villa pruning the fruit trees, weeding, and so on:
and, as usual, that's when the best programming ideas come to me.

capellan
Posts: 654
Joined: Wed Aug 15, 2007 11:09 pm

Re: Controlling an external device

Post by capellan » Fri Apr 10, 2015 8:08 pm

Ok. :D

Why don't you post the content of html file "Roamer-COM3.html"?
Could you share the file "SEROTA-199Roamer-API-Specification.pdf" with this forum?

Al

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10127
Joined: Fri Feb 19, 2010 10:17 am

Re: Controlling an external device

Post by richmond62 » Fri Apr 10, 2015 8:11 pm


Post Reply