serialControlString
Thomas J McGrath III
3mcgrath at adelphia.net
Mon Nov 24 11:30:47 EST 2003
Sarah,
below is the response from the creator of the MacBrick:
I don't know how to send a hex number or how to receive a dot.
When sending a <V000(version number) to the device I do see the green
light on the device blink and the driver does show up in the menu in
SerialTest.
Any help is appreciated,
Tom
> Tom,
>
> It is best if you precede each command with an escape char (hex 27).
> This will draw MacIO's attention. MacIO will respond with a . (dot).
> After receiving the dot, or shortly after sending the esc char
> (microseconds), you can send your command.
> The Command "<V000" should indeed provide you with a response,
> unless the number of byets sent to MacIO is incorrect. (the demo app
> shows the commands it outputs to MacIO, so you can easily check this,
> but I think 5 chars is indeed the command length).
> Every command returns something to the Mac.
> I will download the demo and give it a shot tonight.
>
> Ronald
> On 24-nov-03, at 16:57, Thomas J McGrath III wrote:
>
> Ronald,
>
> I am using Revolution (a scripting software for creating cross
> application programs) it is similar to Hypercard/Supercard and a
> little like Director.
>
> I have been able to open a port to the Driver for the MacBrick. I get
> "/dev/cu.usbserial-3B1" and I get a green light on the unit when
> sending a command to it. I do not get a response back however. I am
> not understanding the reading part from the device.
>
> It is my understanding that if a command is sent to the unit like
> "<V000" that a result is returned? Is that right? I don't need to do a
> read from device to get the result?
>
> The following script is in a mouseUp handler in a button and the fld
> "sendField" is a text field for entering text to send to the unit. The
> 'thePort' is the "/dev/cu.usbserial-3B1" from an popUp button that
> chooses a port/driver. This version has the read from but I have tried
> both ways. If you have the time I would like to figure this out.
> Revolution has a thirty day free demo to download from their website
> at www.runrev.com
>
> put fld "sendField" into theData
> if the hilite of btn "OS X" then
> write theData & eol to driver thePort
> else
> write theData & eol to file thePort
> end if
> put "-> " & theData & return after fld "recField"
> read from driver thePort until eof
> put the result & return after fld "recField"
>
> Let me know what I might be doing wrong.
>
> Thanks
>
> Tom
> PS the device works with the software you provide with the device.
>
On Nov 23, 2003, at 11:17 PM, Sarah wrote:
> Hi Tom,
>
> Have a look at my SerialTest stack at http://www.troz.net/Rev/
> I have altered it recently so that it works with OS X but I have only
> tried it with a Keyspan adapter. If your device shows up in
> driverNames then it will most probably work. My stack will set the
> serialControlString for you (or at least the most important parts of
> it) and handles sending & receiving with various end-of-line
> indicators. See if it works, then poke around in the scripts to see
> what is happening. I think it is reasonably well commented :-)
>
> Cheers,
> Sarah
> sarahr at genesearch.com.au
> http://www.troz.net/Rev/
>
> On 23 Nov 2003, at 4:16 am, Thomas J McGrath III wrote:
>
>> Hello to all,
>>
>> I am trying to understand how to send/receive to a usb I/O board
>> (MacBrick).
>> I am trying to figure out the serialControlString and driverNames
>> function.
>> The device shows up in driverNames as 'usbserial-3B1' So I know REV
>> can see it.
>>
>> But as a newbie I don't know what to do next....
>>
>> Any help in understanding this would be wonderful.
>>
>> Thanks
>> Tom
>>
>> Macintosh PowerBook G-4 OSX 10.3.1, OS 9.2.2, 1.25 GHz, 512MB RAM,
>> Rev 2.1.2
>>
>>
>> Advanced Media Group
>> Thomas J McGrath III ð 2003 ð 3mcgrath at adelphia.net
>> 220 Drake Road, Bethel Park, PA 15102
>>
>>
>> _______________________________________________
>> use-revolution mailing list
>> use-revolution at lists.runrev.com
>> http://lists.runrev.com/mailman/listinfo/use-revolution
>>
>>
>>
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
>
Macintosh PowerBook G-4 OSX 10.3.1, OS 9.2.2, 1.25 GHz, 512MB RAM, Rev
2.1.2
Advanced Media Group
Thomas J McGrath III ð 2003 ð 3mcgrath at adelphia.net
220 Drake Road, Bethel Park, PA 15102
More information about the use-livecode
mailing list