05-03-2021 07:34 AM - edited 05-03-2021 07:37 AM
Hi mc,
why don't you cleanup your block diagram? It would really help in understanding what that code does:
(I guess you only read one value per Modbus read call so I use IndexArray to use only the first element of the read responses…)
05-05-2021 04:06 AM - edited 05-05-2021 04:07 AM
Hi GerdW,
1 data is 32bit and it consists of two 16-bit registers that I read, so is this way correct?
And thaaaaank You very much for help!
05-05-2021 04:19 AM
Hi mc,
@mc50100 wrote:
1 data is 32bit and it consists of two 16-bit registers that I read, so is this way correct?
The "correctness" depends on the byte/word order, maybe you need to switch the high/low word at the Join function.
Your block diagram is not cleaned up, there are a lot of hidden (and so seemingly broken/bended) wires…
05-05-2021 04:57 AM
And I have this one problem, I need to save my data in .csv file, I upload my VI and Sub VI for that part of program, but you can see that my header is not good because every measurement need to be in own column.
If you need I can upload my program. Thank you!
05-05-2021 05:31 AM - edited 05-05-2021 05:38 AM
Hi mc,
@mc50100 wrote:
I need to save my data in .csv file, I upload my VI and Sub VI for that part of program, but you can see that my header is not good because every measurement need to be in own column.
Well, real VIs instead of snippets would have been nice… (But snippets are much better than plain images!)
The header looks ok for me:
At this stage the files you create are fine - but your example CSV file also includes quotation marks around the remaining content! Where are those quotation marks are coming from?
Other stuff:
While I commonly use FormatIntoString in favor of several ConcatString functions you really need to check those constructs in your code.
See this example:
One of both ways is much simpler than the other…
05-05-2021 07:17 AM
Thank you, I did everything what you said but but the header is again written in one column instead of being separate for each measurement (csv.png)
I also have question because I need to use Write Delimited Spreadsheet instead of writespreadsheetstring, so do I need convert string Header to array (in File init.vi) or not to convert the array to a spreadsheet string in the FileHeader.vi?
05-05-2021 07:59 AM
Hi mc,
@mc50100 wrote:
the header is again written in one column instead of being separate for each measurement (csv.png)
I also have question because I need to use Write Delimited Spreadsheet instead of writespreadsheetstring, so do I need convert string Header to array (in File init.vi) or not to convert the array to a spreadsheet string in the FileHeader.vi?
Ah, now I see…
Two options:
05-10-2021 08:10 AM - edited 05-10-2021 08:12 AM
Hi guys,
I'm finishing the project, but I had 2 big problems.
The first problem: in the Consumer loop when I want to write data to a file, the data is written to me when I just start the program and they are not refreshed further. I think the problem is in the queues, but I'm not sure how to solve it so that my data is refreshed (the program is attached).
Second problem: I have to arrange the measurements below each title (attached txt) to be in columns.