HOME

PRODUCTS 

Navigation FRAME

HX19 Program Utilities

The hx19 device configuration box

The above sets receiver 40. It responds by shutting is LED off (no blue flashes when it detects USID/RFID). It enters battery savings mode and sets first sonic wave front detection. Then it proceeds to receive on channel 108 and transmit on channel 109. When data is received through a properly set USB port, (See port setup in the package documentation) this program will display the incoming data in a pop up window (see below). If there is no data no window will pop up.

The display window on the right shows the results from receivers R40, R41, R42 and R43. If there are more receivers in range they will be appended according to their q switch value. At rates of 16 s/s up to 6 receivers are accommodated by the time slice available. At rates of 8 s/s 30 receivers are accommodated by the time slice, and at 4s/s 90 can be displayed. If you have more receivers per system each receiver should be polled. (see the polling example). The data is displayed in mm, e.g. R40 P21 A2890 indicates there are 2890 mm from receiver R40 to tag point 21. Similarly there are 2666 mm between tag 20 and receiver R42.

The REBOL access program allows a file to be broadcasted to all devices listening on the broadcast channel. For example name a text file hx19setup.txt, and enter data as follows:

R40&m2 q1 [ok] t104
R41&m2 q2 [ok] t104
R42&m2 q3 [ok] t104
R43&m2 q4 [ok] t104

M1&m16 s1 r104 $

In the above R40 is set to USID mode, and given the q order 1, if for example it was given the q order 5, it would display last in the window to the right. The [ok] simply commands the receiver to broadcast ok after it receives the configuration string. The receivers in the above will all transmit their result on RF channel 104 which is around 2.5Ghz, out of WiFi range. Finally M1 is instructed to call tags X#0 through X#0, the most significant digit is irrelevant. The M1 is set to receive on channel 104, where it will receive what is transmitted by the receiver. The mode m16 is good when the hx19ms does not receive on its own transmitting channel, it sends an acquisition marker. Finally $ sets the strobe action, the strobe action can be set with the f switch to select 16s/s 8s/s or 4s/s.

 

The program below is written for a REBOL interpreter, you can find this interpreter for free download online at http://www.rebol.com/download-view.html the hx19demo should run identically across all REBOL supported platforms,

Once the REBOL view program has been installed on your computer, copy and paste the following into win notepad or the text editor for your OS (LINUX)  and save as hx19demo.r double click hx19demo.r and if your hx19ms is connected the program will run, otherwise it will complain over a missing serial port. Once the REBOL view program is on your computer, you can modify and run the following, or create your own code.

REBOL[MY TEST]


System/ports/serial: [ com5 ] ;if using linux this line is slightly different
ser: open/direct/no-wait serial://port1/250000/none/8/1 
ser/rts-cts: false
update ser
buffer: make string! 1
logFile: "Hx19log.txt"
bb: 0 bc: 0 tt: ""


;Following function computes xx string checksum and appends /hexsum to the string
;where hexsum is the hexadecimal representation of the sum of the string characters

hx19: funct [xx]
[
    pp: copy xx
    ss: 0
    foreach char pp [ss: ss + char]  
    hx: to-hex ss
    until [sn: take hx sn > #"0"]
    insert hx sn
    append pp "/" append pp hx append pp CR
    return pp
]

;following function sets the display layout with check buttons and etc.
view/new/title layout 
[
    across 
    label "SYNC"
    check [
               either bb > 0 
                [bb: 0 insert ser hx19 "M&%" update ser]
                [bb: 1 insert ser hx19 "M&$" update ser]
              ]
     label "LOG"
     check [
                either bc > 0  [bc: 0 close log][bc: 1 log: open/new %hx19log.txt]
               ]
      f: field 200
      btn "TX" [insert ser hx19 f/text update ser]
      btn "SetUP File" 
             [
               px: read/lines %hx19setup.txt
               repeat nn 20
               [
                 kk: pick px nn
                 if 0 = length? kk [break]
                 print kk
                 insert ser hx19 kk update ser
                 wait 0.05
               ]
             ]
] "HX19 ACCESS"

insert-event-func [switch event/type [close [close ser if bc > 0 [close log] quit]]event]
;the following code monitors incoming data from the serial port and prints in a ;popup box
forever [
       until [
                while[empty? buffer][read-io ser buffer 1 wait 0.0001]
                x: to-integer first buffer
                append tt buffer
                clear buffer
                x = 13
              ]
              print tt
              if bc > 0 [append log tt]
              clear tt
            ]

>

Copyright 1999 [Hexamite]. All rights reserved. Revised: .

<<