This method is used to format and send commands to the DataHub, and should only be used by those very familiar with the operation of the DataHub. The DataHub command set is described in the Using Commands chapter of the Cogent DataHub manual. To send a command to the DataHub, it must be formatted such that strings and control characters are preserved through the message transfer and delivery process. The specialized format control specifiers of sendLispMessage make this easy to do.
![]() | The writeCommand method gives a similar functionality for Java and C#. |
The format control string is similar to that used by printf, with the following differences:
![]() | The string parameters corresponding to the %s, %a or %A field type specifiers must be of type char *. |
void CSetpoint::BuildObjectHierarchy(LPCTSTR sDomain, LPCTSTR sAssembly)
{
CT2A aDomain(sDomain);
char *domain = aDomain;
CT2A aAssembly(sAssembly);
char *assembly = aAssembly;
CT2A aName(sName);
char *name = aName;
// (assembly domain name)
pCnx->sendLispMessage(TRUE, "(assembly %s CSetpoint)", domain);
// (subassembly domain assemblyname subassemblyname instancename)
pCnx->sendLispMessage(TRUE, "(subassembly %s %s CSetpoint %s)", domain, assembly, name);
// (property domain attrname propid propname type rw dflt_value dflt_conf)
pCnx->sendLispMessage(TRUE, "(property %s CSetpoint auto AutoMode int rw 0 100)", domain);
pCnx->sendLispMessage(TRUE, "(property %s CSetpoint auto AutoTime r8 rw 0 100)", domain);
}Copyright © 1995-2012 by Cogent Real-Time Systems, Inc. All rights reserved.