nativetool
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| nativetool [2024/07/18 12:12] – created wikiadmin | nativetool [2024/07/18 14:34] (current) – wikiadmin | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | This C example uses the code generated from TransSECS using the // | ||
| + | |||
| + | 1. Start TransSECS and load the GEMTool Sample Project. Generate the code with the NativeWrapper option selected for deployment. The code will be generated in the GEMTool\NativeWrapper folder. | ||
| + | < | ||
| + | new_wrapper_with_classpath(" | ||
| + | </ | ||
| + | |||
| + | 2. The header file (transsecs.h) is available here: [[https:// | ||
| + | |||
| + | 3 . The dll (transsecs.dll) is available here: [[https:// | ||
| + | |||
| + | To prepare for testing this example, please load the SECSTester provided with TransSECS or load GEMHost Sample Project and generate the code so that TransSECS Builder in run/test mode can be used as a test Host. | ||
| + | |||
| + | Here's the full C code example: | ||
| + | |||
| <code c> | <code c> | ||
| #include " | #include " | ||
| Line 57: | Line 72: | ||
| wrapper_start_main(wrapper, | wrapper_start_main(wrapper, | ||
| + | double gasflow = 1.0; | ||
| while (1) { | while (1) { | ||
| - | // If the program exits the tool will exit as well, so in this case we just stall indefinitely | + | // Publish a test float value to the wrapper |
| - | sleep(1); // Sleep for 1 second | + | publish_float(wrapper, |
| - | } | + | gasflow += 1.0; |
| - | + | // Trigger | |
| + | trigger(wrapper, " | ||
| + | // Trigger an alarm - to guarantee that the alarm is triggered, for this example | ||
| + | transsecs_alarm(wrapper, | ||
| + | transsecs_alarm(wrapper, | ||
| + | sleep(10); | ||
| + | } | ||
| return 0; | return 0; | ||
| } | } | ||
| </ | </ | ||
nativetool.1721319163.txt.gz · Last modified: by wikiadmin
