04-21-2023 11:35 AM - edited 04-21-2023 11:53 AM
Today I tried out the "documentation from source code" feature in LabWindows 2017. Using Shift-Ctrl-G before a function, it spits out the template for me to customize. Nice.
But, even though I have multiple functions in the file, each with the template, it only generates the XML/HTML for the first function:
/// HIFN Create a message structure with buffer populated and ready to be sent to the receiver.
/// HIRET Copy of the newly created message structure.
/// HIPAR type/Message type byte.
/// HIPAR systemState/System state byte.
/// HIPAR commandCode/Command code byte.
/// HIPAR dataBytesPtr/Pointer to data bytes, or NULL if none.
/// HIPAR numDataBytes/Number of data bytes byte, or 0 if none.
MessageStruct CreateMessage (uint8_t type, uint8_t systemState,
uint8_t commandCode,
void *dataBytesPtr, uint8_t numDataBytes)
{
...
}
/// HIFN This returns a BufferStruct with the buffer data being the series of bytes representing the complete message with header, dataBytes and checksum at the end.
/// HIRET Copy of the newly created buffer structure.
/// HIPAR msg/Message structure.
BufferStruct BuildBufferFromMessage (MessageStruct msg)
{
...
}
/// HIFN This will populate a MessageStruct and return it. This is the "safe" version of the call which uses a BufferStruct copy passed in. This avoids any chance of a crash due to a bad pointer or size count. It is safe to use, and the "FromBytes" version should only be used if speed is more important than safety.
/// HIRET Copy of the newly created buffer structure.
/// HIPAR buf/Buffer structure.
MessageStruct BuildMessageFromBuffer (BufferStruct buf)
{
...
}
Is there a limit to one function per file with this feature? Or something else I need to do?
Also, if I use multiple //HIFN lines for my help (to keep the source code nice) it seems to split up the help on those shorter lines, and I have to put it all one one line to let the help file wrap it as needed. Is there a way to specify "text continues"? I tried backslash, but that did not work:
///HIFN This is my help file that I want
///HIFN to just be on one line...
Thanks, much.
Solved! Go to Solution.
04-21-2023 11:55 AM - edited 04-21-2023 11:56 AM
SOLVED: It appears a blank line must be before the tags in some cases. This works:
// "But if safety and simplicity are the primary concerns, passing structures
// by value is generally the safer approach."
/// HIFN Create a message structure with buffer populated and ready to be sent to the receiver.
/// HIRET Copy of the newly created message structure.
/// HIPAR type/Message type byte.
/// HIPAR systemState/System state byte.
/// HIPAR commandCode/Command code byte.
/// HIPAR dataBytesPtr/Pointer to data bytes, or NULL if none.
/// HIPAR numDataBytes/Number of data bytes byte, or 0 if none.
MessageStruct CreateMessage (uint8_t type, uint8_t systemState,
uint8_t commandCode,
void *dataBytesPtr, uint8_t numDataBytes)
{
/*****************************************************************************
* Using the old C style comment markers.
*****************************************************************************/
/// HIFN This returns a BufferStruct with the buffer data being the series of bytes representing the complete message with header, dataBytes and checksum at the end.
/// HIRET Copy of the newly created buffer structure.
/// HIPAR msg/Message structure.
BufferStruct BuildBufferFromMessage (MessageStruct msg)
{
#TheMoreYouKnow