Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: NaturalTinyShell_ice libmDot-12Sept mbed-rtos mbed
Fork of ICE by
Diff: src/CommandParser/cmd.cpp
- Revision:
- 190:af7ab603c9fe
- Parent:
- 188:d35a74bf4e92
- Child:
- 197:594afd088f32
--- a/src/CommandParser/cmd.cpp Wed Oct 05 21:51:01 2016 +0000
+++ b/src/CommandParser/cmd.cpp Thu Oct 06 15:24:10 2016 +0000
@@ -970,7 +970,7 @@
std::map<std::string, ModbusRegister>::iterator iter;
for (iter = ModbusRegisterMap.begin(); iter != ModbusRegisterMap.end(); ++iter) {
ModbusMasterReadRegister( iter->first, &value );
- printf("tag=%s, name=%s, units=%s, node=%d, reg=%d, size=%d, order=%d, value=%2.2f, valid=%d\r\n", iter->first.c_str(), iter->second.name.c_str(), iter->second.units.c_str(), iter->second.node, iter->second.reg, iter->second.size, iter->second.order, value.value, value.valid );
+ printf("tag=%s, name=%s, units=%s, node=%d, reg=%d, rtype=%d size=%d, order=%d, value=%2.2f, errflag=%d\r\n", iter->first.c_str(), iter->second.name.c_str(), iter->second.units.c_str(), iter->second.node, iter->second.reg, iter->second.rtype, iter->second.size, iter->second.order, value.value, value.errflag );
}
}
@@ -1211,7 +1211,7 @@
"\"max\": \"300\", "
"\"node\": \"1\", "
"\"reg\": \"9\", "
- "\"rtype\": \"1\", "
+ "\"rtype\": \"4\", "
"\"type\": \"0\", "
"\"size\": \"2\", "
"\"order\": \"2\", "
@@ -1243,7 +1243,7 @@
"\"max\": \"300\", "
"\"node\": \"1\", "
"\"reg\": \"11\", "
- "\"rtype\": \"1\", "
+ "\"rtype\": \"4\", "
"\"type\": \"0\", "
"\"size\": \"2\", "
"\"order\": \"2\", "
@@ -1276,7 +1276,7 @@
"\"max\": \"6000\","
"\"node\": \"21\","
"\"reg\": \"18\","
- "\"rtype\": \"1\","
+ "\"rtype\": \"4\","
"\"type\": \"1\","
"\"size\": \"2\","
"\"order\": \"2\","
@@ -1308,7 +1308,7 @@
"\"max\": \"80\","
"\"node\": \"21\","
"\"reg\": \"10\","
- "\"rtype\": \"1\","
+ "\"rtype\": \"4\","
"\"type\": \"1\","
"\"size\": \"2\","
"\"order\": \"2\","
@@ -1329,6 +1329,38 @@
ModbusMasterMailBox.put(mail);
Thread::wait(1000);
+
+ // INPUT: Product Factor
+ snprintf(buf, sizeof(buf),
+ "{ "
+ "\"id\": \"i_pfac01\","
+ "\"name\": \"Product Factor\","
+ "\"units\": \"PPM\","
+ "\"min\": \"0\","
+ "\"max\": \"10000\","
+ "\"node\": \"1\","
+ "\"reg\": \"40\","
+ "\"rtype\": \"3\","
+ "\"type\": \"0\","
+ "\"size\": \"2\","
+ "\"order\": \"2\","
+ "\"fmt\": \"%%.2f\","
+ "\"vcmd\": \"\","
+ "\"rfreq\": \"5\" }");
+ rc = GLOBAL_mdot->saveUserFile("input_i_pfac01.json", (void *)buf, MAX_FILE_SIZE);
+ if ( rc != true ) {
+ printf("\rFailed to save input_i_pfac01.json\n");
+ return;
+ } else {
+ printf("\r...generated input_i_pfac01.json\n");
+ }
+
+ mail = ModbusMasterMailBox.alloc();
+ mail->action = ACTION_READ_FILE;
+ strncpy( mail->controlFile, "input_i_pfac01.json", (sizeof(mail->controlFile)-1));
+ ModbusMasterMailBox.put(mail);
+
+ Thread::wait(1000);
// OUTPUT: Relay 01
snprintf(buf, sizeof(buf),
