Version 3 (modified by 15 years ago) ( diff ) | ,
---|
Table of Contents
- Application Libraries
- Database Libraries
- Standard 825 Library with Application class (lib825)
- Standard 825 Library with EVENT features (lib825ev)
- Communications Functions
- CComm
- CCommClient
- CCommSerial
- CCommServer
- Analog Output (DAC Digital to Analog Conversion) Functions
- GetDAC
- GetDACPercent
- GetDACRangeFromIndex
- GetIndexFromDACRange
- SetDACFloat
- SetDACOutputRange
- SetDACPercent
- SetDACReg
- SetDACTrackGrossNet
- SetDACTrackScale
- StopDACTrackScale
- Debug Functions
- DEBUG_MSG
- DEBUG_SHOWDATA
- Display Functions
- CBitmap
- CFont 825gen2
- CImage 825gen2
- ClearLCD
- DisplayStr DEPRECATED - Replace with DisplayText
- DisplayText
- GetX
- GetY
- InitLCD
- IsFontLoaded
- LocateLCD
- PrintLCD
- PrintLCDbutton
- PrintLCDfont2
- ReadFont
- SetBkColor
- SetCurColor
- File Functions
- CFile
- FileCopy
- FindChromiumPath 825gen2
- FindFlashDrive 825gen2
- GetFilesInPathWithExtension
- IsMounted
- MakeDirIfNotExists
- MountDirectory 825gen2
- UnmountDirectory 825gen2
- Form Functions
- CForm
- CFormRect 825gen2
- EVENT
- EVENT_FLAG_SHOW
- EVENT_SHOW_BTN_CONTENT
- EnableItem
- ExitWithCode
- FORM_ADD_BUTTON
- FORM_ADD_BUTTON2 825gen2
- FORM_ADD_INPUT
- FORM_ADD_INPUT2 825gen2
- FORM_DONE_ESCAPE
- FORM_DONE_EVENT_EXTERNAL
- FORM_DONE_LEFT_ARROW
- FORM_HIDE
- FORM_INIT
- FORM_IS_UPDATED
- FORM_RUN
- FORM_SHOW
- FindName
- GetCurrentItemIndex
- GetExitCode
- GetItem
- !GetItemByIDVal
- GetItemCount
- GetItemIndex
- HideItem
- IN_EVENT_HIDE_FORM
- IN_EVENT_SHOW_FORM
- IN_EVENT_WRITE_DATA
- IsChanged
- SetInputFont
- SetKeyEvent
- ShowItem
- WriteData
- Input / Output (Digital I/O) Functions
- GetInput
- GetInputMask
- GetOutput
- SetDIOCounter
- SetOutput
- SetOutputMask
- StartDIOPulse
- StartRepeatIO Deprecated
- StopDIOPulse
- StopRepeatIO Deprecated
- Keypad/Sound Functions
- ClearKeyBuffer
- KeyPadInsertKey
- KeyPadSetUSBEvent
- OpenBeeper
- PlayNotes
- WaitKeypress
- Process Functions
- GetProcessID
- GetProcessIDExcludeSelf
- KillProcess
- ResetPrevGrossWt
- ResetPrevNetWt
- ResetPrevTareWt
- test
- String Functions
- FloatToStr
- IntToStr
- StrFmt
- StrFmtLen
- StrToFloat
- StrToInt
- StrTrimLeft
- StrTrimRight
- Ticket Functions
- CTktFlds
- PrintTkt
- Time and Date Functions
- CMillisecondTimer
- CSleep
- CTimer
- DoSleep
- GetDateStr
- GetLinuxTime
- GetTimeStr
- IsTimeChanged
- ResetPrevTime
- SleepMilliseconds
- SleepSeconds
- Utility Functions
- GetKernelVer
- GetKernelVerStr
- GetLoaderVer
- GetLoaderVerStr
- GetMemFree
- GetMnBdVer
- GetMnBdVerStr
- Weighing Functions
- CheckWIM * DEPRECATED - New apps should use MnBdSetWIM *
- DLCRepeatMultiIncludeCellWts
- FormatGrossWt
- FormatNetWt
- FormatTareWt
- FormatWt
- GetBelowZero
- GetCapacity
- GetCenterZero
- GetCurUnitsLabel
- GetDecimal
- GetGrossWt
- GetInterval
- GetMotion
- GetNetWt
- GetNumScales
- GetOverCap
- GetProcessScale
- GetSecUnitsLabel
- GetTareWt
- GetUnitsLabel
- GetWtError
- IsGrossWtChanged
- IsNetWtChanged
- IsTareWtChanged
- IsWtStatusChanged
- IsWtUnitsChanged
- MnBdClearEvent
- MnBdClose
- MnBdGetErr
- MnBdGetErrMsg
- MnBdGetErrMsgStr
- MnBdOpen
- MnBdProcess * DEPRECATED - New apps should use StartRepeatMulti *
- MnBdRead
- MnBdRequest
- MnBdSetEvent
- MnBdSetWIM
- MnBdShutdown
- MnBdStartup
- RequestWt * DEPRECATED - New apps should use StartRepeatMulti *
- ResetPrevGrossWt
- ResetPrevNetWt
- ResetPrevTareWt
- ResetPrevWtStatus
- ResetPrevWtUnits
- SetTareCurrent
- SetTareValue
- SetWIM * DEPRECATED - New apps should use MnBdSetWIM *
- StartRepeatMulti
- StartRepeatWt * DEPRECATED - New apps should use StartRepeatMulti *
- StopRepeatMulti
- StopRepeatWt * DEPRECATED - New apps should use StopRepeatMulti *
- ZeroScale
- Development Environment
- Application Signing
- Debugging
- Setup for Software Development
- Version Control
- Device Support
- Device Drivers
- Beeper
- Display
- Network
- Serial Ports
- USB Support
- Weighing
- Foundation
- Application Mode Startup
- Shell operations - Linux / Windows command line Reference
DIO
Digital I/O
echo “L000000020000000F” > /dev/mnbd
This sets the state of the mainboard digital outputs. The “L” is the command, the following 8 characters or four hexadecimal bytes represent the state desired. The final 8 characters or four hexadecimal bytes represent a mask of which outputs are to be affected. In this example “F” is used as the mask to set the state of all four on-board outputs.
# echo “I” > /dev/mnbd
This requests the status of the mainboard digital I/O.
# cat < /dev/mnbd
response:
# IA000000000
The last 8 character of the response are hexadecimal digits. Of these the first 4 digits are the state of the digital inputs. The final 4 digits are the state of the outputs. If the input 1 only is active the response is:
# IA000010000
If inputs one and two are active the response is:
# IA000030000
If inputs one, two, three, and four are active the response is:
# IA0000F0000
Only a single hexadecimal digit is needed to represent the state of the four mainboard inputs.
Response | Input 1 | Input 2 | Input 3 | Input 4 |
0 | Off | Off | Off | Off |
1 | On | Off | Off | Off |
2 | Off | On | Off | Off |
3 | On | On | Off | Off |
4 | Off | Off | On | Off |
5 | On | Off | On | Off |
6 | Off | On | On | Off |
7 | On | On | On | Off |
8 | Off | Off | Off | On |
9 | On | Off | Off | On |
A | Off | On | Off | On |
B | On | On | Off | On |
C | Off | Off | On | On |
D | On | Off | On | On |
E | Off | On | On | On |
F | On | On | On | On |
For additional structure formats refer to MainboardProtocol
The lib825 library provides functions to facilitate applications performing digital I/O tasks.
For digital I/O event operations refer to the DioEvent class.
DIO Events
About
This document will guide the programmer through the process of creating and using a simple DIO Event using the DioEvent class provided in the standard library (lib825). DIO Events are processed by the mainboard in order to allow a level of redundancy. Should the OPI board kernel crash the mainboard will continue to provide relay functionality and will disable events when their thresholds are reached.
The Code
To use a DIO event follow the example code below.
The above code would create an event that would enable board 0 (mainboard) pin 0 when the gross weight of scale 1 is less than 250.00 and greater than 0.00.
DIO Counting
Description
Mainboard software 1.15 is required for counting feature. Kernel 2009-10-07 or later is required. All four inputs of the mainboard may be used for counting. The DIO cards allow any one of inputs 1 - 7 to be used for counting. Input 8 may also be used for counting. This allows for up to two inputs per DIO card to be used for counting.
Example
USB Support
The Cardinal 825 supports many USB devices such as Flash Drives, Printers (Cardinal supported only!), keyboards, and mice.
USB Mass Storage
The 825 supports USB flash storage devices formatted with the FAT (file allocation table) and FAT32 file systems. From the serial command line when a USB storage device is inserted the display will appear similar to:
Use the mount command to access files on the USB flash drive:
mount –t vfat /dev/sda1 /mnt/fl1
The files will then appear in the path /mnt/fl1 such as:
The file manager may be used to access USB flash drives. When the /mnt/fl1 folder is selected the file manager will automatically perform the mount command.
USB Keyboards
As of kernel 2008-11-13 many USB keyboards should work with the 825. Simply plug the keyboard into an 825 USB connection.
Applications using the lib825 functions such as [[lib825:source:trunk/kypdbeep.cpp#L78 ReadKeypad]] or [[lib825:source:trunk/form.cpp#L1027 FormLCD] will automatically work with the USB keyboard. To test the keyboard without any app running type some characters on the keyboard and type:
# cat /dev/usbkybd
Output:
The characters typed on the USB keyboard should show on the serial port terminal.
USB Printing
usblp.ko device driver module for usb printing support. Type:
# modprobe usblp
Kernel should be configured with /dev/usblp0 device node. If not type:
# mknod /tmp/usblp0 c 180 0
/dev is in read-only file system so device node can be created under /tmp instead
This creates the character device driver with major number 180 and minor number 0. This should work unmodified with USB printers that accept raw text for printing using a default font.
A simple test is:
# echo “ABCDEFGH” > /dev/usblp0 '''or''' # echo “ABCDEFGH” > /tmp/usblp0
Applications may be written to open “/dev/usblp0” to print to USB printer 0 instead of “/dev/ttyS1” to open COM2
Successful Tests
- Okidata Microline 320 Turbo - Older versions of this printer do not have USB port
- Hewlett Packard DeskJet 830C - Does not print page until filled so extra line feeds are required to fill the page to finish the print
Currently Developing
- HP LaserJet P1020
Unsuccessful
- HP LaserJet P1006 - Research indicates this printer requires host to send firmware update file to printer, and does not accept raw text but requires XQX stream protocol
USB to PC communications
To load the driver for USB to PC communications type:
# modprobe g_serial use_acm=1
When the 825 is connected to the PC it will be recognized by the PC and if the driver is not already installed it will prompt for it. Refer to “gadget_serial.txt”
When the driver is installed the PC will appear to have another COM port. For testing on the PC you can then open a communications program such as HyperTerminal and set it to the appropriate COM port (which is actually a USB connection).
On the serial connection to the indicator type:
# echo “abcdefg” > /dev/ttygserial
“abcdefg” will then appear on the Hyperterm display.
In HyperTerminal, type:
123456
On the serial connection to the indicator type:
# cat < /dev/ttygserial
The received characters “123456” from the PC will then be displayed.