Hi All,
Had a question this week from a customer with a device + corresponding driver he’d written himself in C++. He wanted to use groov as a front-end. No Opto 22 hardware at all, an no OPC UA Servers handy either. (He had a small device, I believe a scale, and his custom software to control/monitor it from a Windows PC.)
My suggestion:
Use our OptoMMP as the glue/API between groov Server for Windows + SoftPAC and his C++ driver.
All he needs:
- [[U][B]SoftPAC[/B][/U]](http://www.opto22.com/lp/pc_based_controller.aspx) - which may be purchased separately and used with (FREE!) PAC Project BASIC, also included with (not free) PAC Project Pro, and includes our OptoMMP (memory map).
- [I]groov[/I] Server for Windows - [[B][U]free trial here[/U][/B]](http://groov.com/free-trial/)
- The [[B][U]C++ OptoMMP Communication Tookit[/U][/B]](http://www.opto22.com/site/downloads/dl_drilldown.aspx?aid=4420) for Windows, etc. (FREE!) to connect his C++ code to the memory map.
- A little logic to move data to/from SoftPAC's mem map. See details/attachments below.
For my example logic, I somewhat arbitrarily chose to use, as the glue in the memory map:
- 1000 Float "inputs" - coming FROM the mem map, Scratch Pad (SP) area [elements 0 - 999]
- 1000 Float "outputs" - going TO the mem map, Scratch Pad Integer area [elements 1000 - 1999]
- 1000 Int 32 inputs - FROM mem map, SP Floats [elements 0 - 999]
- 1000 Int 32 outputs -TO mem map, SP Floats [elements 1000-1999]
Both the toolkit & SoftPAC include commands like:
[INDENT] GetScratchPadIntegerArea, GetScratchPadFloatArea
SetScratchPadIntegerArea, SetScratchPadFloatArea[/INDENT]
In the SoftPAC logic, I load up some ready-to-groov corresponding tags called:
[INDENT]
- ntInputInt32s [0 .. 999]
- ntOutputInt32s [0 .. 999]
- ftInputFloats [0 .. 999]
- ftOutputFloats [0 .. 999]
For convenience, I also added 4 string tables with corresponding names, to be used as labels/notes in groov as to what each of those elements/values represent, 50 characters each.
All of these 1000-elements-each tag/tables can be easily imported into groov (using the idb.txt included below), then attached to one of a variety of gadget choices:
To load the logic into SoftPAC, no need to even look at it or run PAC Control! You can load the attached .cdf using PAC Terminal’s File > Download Control Engine Download File (CDF). FYI, that download could also be done using [U][B]PAC Terminal’s command-line option[/B][/U], for example, from that C++ code.
Not that you NEED to see the logic running on SoftPAC to move data from tag/groov tables to mem map tables, but here’s what it looks like, just a handful of blocks/commands:
Just a little bit of glue and you can groov your own C++ stuff! Yet another example of how we play well with others.
Questions? Comments? Do share!
-OptoMary
groovIDBtxt_and_the_cdf.zip (2.87 KB)