Host Engineering Forum
General Category => Do-more CPUs and Do-more Designer Software => Topic started by: Mike Nash on September 20, 2017, 10:54:22 AM
-
Wow! (Now I get to see if it will work under Win XP too.)
My current project may get to try out some of these new features!
Download complete, entering explore mode...
-
(Now I get to see if it will work under Win XP too.)
You realize that we want to add more and more features that require more and more bandwidth of your PC.
Sometimes, you just need to let go and move on. ;D
-
(Now I get to see if it will work under Win XP too.)
You realize that we want to add more and more features that require more and more bandwidth of your PC.
Sometimes, you just need to let go and move on. ;D
I know, but... ports, old hardware/software to be supported, trackpad that doesn't autonomously reprogram PLCs by itself, fondness for familiarity, non-transferable licenses, etc.
Not to mention operating systems changing overnight (thanks to updates) and breaking stuff. And if you don't let it, you can no longer access stuff. Slippery slope.
-
Anyway, it at least looks to be working in XP with a BRX.
About the ASCII Default Display Format in the User Data Type - I can select this for any of the word or byte data types - but how do I go about getting a string into it? I probably ought to know this already, but it's less painful to just ask. I do realize it is not really a string, but it looks like it could be useful for naming an array entry (Recipe7.Name = "Fried Chicken Suckers").
-
but it looks like it could be useful for naming an array entry (Recipe7.Name = "Fried Chicken Suckers").
Sadly, no. A STRING is a structure, along with User Data Types. But Do-more does not support nested structures.
What you are seeing is a way to format a numeric DWORD or WORD or BYTE's DEFAULT DISPLAY format. Normally, it's 2's complement decimal integer. But you may want to look at in HEXADECIMAL or even OCTAL. We also have ASCII/SWAPPED ASCII. So, if you had a DWORD that is 4 BYTEs long, you could look at it as ASCII if that came from the source that way (think of a Modbus Holding Register that contained text, e.g. 0x44434241 would be "ABCD" ASCII or "DCBA" SWAPPED ASCII (I may have those backwards)).
I guess you could technically stick a bunch of DWORD members in a structure to make up a name (e.g. 4 DWORDs called .Name1, .Name2, .Name3, .Name4 for up to 16 character name), but that really isn't a "string" or even particularly useful.
One way around this would be to have two data-blocks - a block called RecipeName, and another block called Recipe, and the ID/Index of the two blocks correspond to each other, so RecipeName7 would be "Fried Chicken Suckers", but Recipe7.CookTime Recipe7.CookTemp would be two fields in the Recipe7 structure of the Recipe block.
-
I figured the string was a no go. I did get there using .NameA .NameB, etc.
I figured wrongly I couldn't use numbers such as .Name1 - glad to see I was wrong on that.
I thought the COPY was going to be easy with the "Count" but it wanted to put the 4 digit values into Recipe1.NameA, Recipe2.NameA rather than incrementing .NameA to .NameB, etc. Makes sense, but of course I am always looking for the non-sense solutions. ;) But it does work as long as I type them all in to the dialog box.
Auto select for arrayed data always makes it Recipe0-31 so it winds up easier to just type it out.
But STRGETB SS0 to D0 length 16, then COPY those D's to .Name1, .Name2 does get it into the "recipe". So far so good!
-
Sometimes, you just need to let go and move on. ;D
Maybe somebody can do an XP skin for WinX!
Just kidding -- when I can no longer use W7 it'll be Mac or Linux or BSD on bare metal and Windows only in VM's. No Microshaft past 7 (on bare metal) for this guy.
-
But STRGETB SS0 to D0 length 16, then COPY those D's to .Name1, .Name2 does get it into the "recipe". So far so good!
That is definitely the way to do it, if you like that sort of thing.
I like the corresponding data-block idea myself (i.e. RecipeName String data block and the corresponding Recipe RecipeStruct UDT data block).
-
I know, but... ports, old hardware/software to be supported, trackpad that doesn't autonomously reprogram PLCs by itself, fondness for familiarity, non-transferable licenses, etc.
Not to mention operating systems changing overnight (thanks to updates) and breaking stuff. And if you don't let it, you can no longer access stuff. Slippery slope.
Virtual machines are your friend, my brother! VMWare can even virtualize a machine in place (use their Converter program) and in my experience AB and GE licenses survive it just fine. Siemens licenses you can readily move around so you can move it to a thumb drive while doing the conversion. ;D
Virtual PC is probably a tiny bit simpler, but not quite as powerful as VMware. There's Virtual Box too, and tons of others.
-
But Do-more does not support nested structures.
Well, time to get on that! It's important! ;D
Thanks for the update BTW -- going through the PDF now.
-
It's like having an extra Holiday in September!! :D
-
From Updates.PDF:
COPY – Copy Data lets you perform most of the data assignment operations in one compact
instruction. It merges the functionality of MOVE, MOVER, and SETNUMR for numeric data;
SET/RST, SETR/RSTR for bit data; copying entire structures and ranges of structures; and
moving Strings of different maximum lengths between each other, for example moving SS0 to
SL5.
Seems like it supersedes MAPIO as well.
-
Seems like it supersedes MAPIO as well.
Yes. MAPIO is similar to COPY in that it just wraps other core instructions. MAPIO was JUST for BITs, since Bit Mapping I/O is a "thing".
-
MAPIO was JUST for BITs, since Bit Mapping I/O is a "thing".
Not in my world! But I do see this mentioned in the help.
When used as intended
-
MAPIO doesn't provide anything you couldn't already do, but it does provide a nicely compact display. I still like using it for the application clarity.
-
MAPIO doesn't provide anything you couldn't already do, but it does provide a nicely compact display. I still like using it for the application clarity.
I have been too, but now with COPY as an alternative, I might switch to using that instead. Have to give it a test run.
-
Here's all the gory details of what COPY can do for you. ;D
See the attached .PDF
-
Nice chart! So it looks like if you want that, COPY (element/value oriented) and MEMCOPY (value agnostic/byte oriented) cover everything except for clearing strings.
-
Nice chart! So it looks like if you want that, COPY (element/value oriented) and MEMCOPY (value agnostic/byte oriented) cover everything except for clearing strings.
COPY also does NOT support setting a STRING or RANGE of STRINGs to a String Literal, whether it's "" or "Hello, world!".
STRINIT may be a new instruction some day.
-
Why does MEMCOPY not work into a string? Danger of including the string terminator? IS there a string terminator, or you just set the .LEN?
-
Oh yeah, that reminds me I was going to put in a feature request to have all UI configuration settings in a common file and have new installs offer to copy the existing configuration settings if any exist.
-
Why does MEMCOPY not work into a string? Danger of including the string terminator? IS there a string terminator, or you just set the .LEN?
MEMCOPY supports STRINGs. The Source and Destination .MaxLength values must match (since the instruction is just blindly copying memory bytes from the Source to the Destination). If the .MaxLength values do NOT match, use STRPRINT or STRSUB - or (duh) the new COPY instruction!
There is no NUL termination character, unless you put one there. The structure's .Length member specifies the "length". Note that if you do append a "$00", it WILL be accounted for in the .Length member!
-
Oops! I was looking at "Write a text to a string" and "Write a text to a range of strings" which MEMCOPY doesn't do, but missed "Write a string to a string" and so on, which it does.
Which raises the question: What do mean by "string" vs. "text"?
-
Which raises the question: What do mean by "string" vs. "text"?
String is a memory based element that is a String structure. Text should be stated as being a "string literal" (yes, quote-pun intended).
SS0 is a string
"Hello, world!" is a string literal; text in the chart
-
How do we populate a user structure with values? I am not seeing in the PDF above how to copy or move or whatever, 7 N or V type locations into a structure I have created which is 7 mixed items of unsigned word or signed word and 16 bit items (which are to be pulled out of the first item.) These are values I would want to read from a Modbus TCP device using MRX.
I don't seem to be able to have the structure be a destination for the MRX. But I also don't seem to be able to simply transfer values from N0-N6 into my heap-item/structure. I figure I can't directly get the bits copied but thought I could do the 7 words at one go.
Hopefully I am just missing something.
-
Structures are kinda special, and in general we haven't encouraged memory layout awareness or access. I guess now that we are allowing you to make your own, we may need to revisit that and make structures valid a source or target everywhere it makes sense. Until we do that, I guess you will have to resort to using MEMCOPY to move data between structures and block memory.
-
This is where it can get tricky.
If you understand C unions, you could do it memory based using MEMCOPY if you laid out your UDT EXACTLY like the Holding Register layout.
If you have never done C unions or what that means or looks like, then just use the new COPY instruction. Casting is allowed.
COPY
N0 MyStruct.FieldA
N1 MyStruct.FieldB
N2:R MyStruct.RealField
N4:0 MyStruct.BitA
N4:1 MyStruct.BitB
N4:2 MyStruct.BitC
etc.
-
If you want a lesson on C unions, export your UDT and paste it here. Also, list the definition of your Holding Registers (are they all signed 16 bit integers? are some bit masks? are some REAL?). UDT layouts can be customized EXACTLY for this purpose.
Note that structures MUST be DWORD aligned, but your remote device data is 7 WORDs (3.5 DWORDs), so your UDT will a PAD with an 8th word. But that is OK - we can make it work.
-
...we may need to revisit that and make structures valid a source or target everywhere it makes sense.
Yes please! :)
This is where it can get tricky.
If you understand C unions, you could do it memory based using MEMCOPY if you laid out your UDT EXACTLY like the Holding Register layout.
If you have never done C unions or what that means or looks like, then just use the new COPY instruction. Casting is allowed.
Well I don't know C but I did figure it out already. You provided enough tools in the configuration, along with that tip and the error messages in MEMCOPY. I did have to COPY the N0 to N7 before the MEMCOPY so N7 would get broken out into the bits in the structure for the last 16 items. That was just a lucky layout on my end.
But I am not sure how well this will work for me in the real world. My test was just a subset of what I would like to have (words to be written via MWX as well as MRX reads in the same structure.) Add in the tendency for manufacturers to randomly move things around and this could get ugly in the real world.
Seriously, for this one product, ModbusRTU requires I add one to the offset and ModbusTCP requires I don't. And some things get moved around product to product or even between revisions of the firmware.
Is there a way to populate a Data View with all of a structure's members without having to pick them one at a time?
-
Is there a way to populate a Data View with all of a structure's members without having to pick them one at a time?
If you want them on their own line, enter the first field of the desired struct then press Shift-Control-Enter.
-
Is there a way to populate a Data View with all of a structure's members without having to pick them one at a time?
Do user structs not do this automagically like internal ones such as timers and so on? Have to try this one out.
-
Do user structs not do this automagically like internal ones such as timers and so on? Have to try this one out.
Sure. If you don't want them as read-only, you have to do what I said.
If you are happy with the multi-line read-only thing, that's one of the attributes on the field.
-
BTW, what's up with the Memory View EITHER being live OR allowing writes?? That's gotta go. :(
-
Thank you! Thank you! I figured I was just missing this, and I do go and look at the hot key list from time to time.