Your explanation in that post is not very complete, and there's a single example. Perhaps if you expanded it, described where the input strings would be found (in a text file?), and what the output should be.
Where do the variables come from? How many functions are there? How many constructs -- #IFDEF is one, what are the others?
Last edited by shg; 05-01-2009 at 02:44 PM.
Entia non sunt multiplicanda sine necessitate
Additions as for SHG's request:
IfDef is asking if this variable is Defined/Dimensioned.
I converted this Variable to a Boolean so i now test if if is True Or False.
EmitToFile in both cases outputs to a flat file (.txt) format.
We just change the extension. In this example we are outputing as a .csv to be imported by a program called WonderWare.
In the original Program the delimiter for functions is a space. It also does not require parentheses or any other formatting characters besides the # and @ symbols. It is a somewhat crude and simple language but it was written by one person to get a job done. Odd fact: You can't multiply in that language, you have to loop an addition formula.
The main Question is not about if the code i wrote will work, it does.
The question is, does anyone know of a plugin or program that can do what the tool described in this website does. If it exists anywhere other than the Excel 2000 Development tools. And if it does exist where someone could get such a thing.
When looking at the example I gave, you can see how much of a mess it is to do the same thing in VBA compared to the original program. it is very Time consuming to write out all the Chr's and " and & to get VBA to output the same line into a flat file as the previous program. If i had the tool described in the website i could take the line:
"#Alarm_Tag\State_Addr1","#Item_Addr1",Word,1,RO,100,,,,,,,,,,"",
put it in the string editor mark the # symboled strings as variables and remove the #'s and i would get the complex string i would have had to construct by simply clicking a button.
Where do you get BP_ADDR in the output string? It doesn't appear in the source.
it from miles up the Module in a completely different Sub. It is a public variable. To understand the whole thing of what is happening you would kinda need the entire Template but it is huge and kinda Company property so i can't just give it out. The BP_ADDR is a long representing a position in Memory for a PLC (Programmable Logic Controller). The module this is in consists of 4,500 comments (comments are the original Code from the original program that i had copied to assist in rewriting it and for explanation of what my code does) and 2,500 lines of code. The entire project consists of 6,200 lines of code .
EDIT: i just noticed exactly what you were talking about the examples i gave don't match...
This is what it looks like now i think i found the solution have been working on it a while. The function emittoCSV looks like this:Please Login or Register to view this content.
So it is basically solved for what the example i gave but there are a ton more todo for a different system set up and the ones that need to to be done are even more complex here is an example:Please Login or Register to view this content.
'@IFDEF EmitCSV @EMITTOFILE WW#PlcName.csv :IOInt,Group,Comment,Logged,EventLogged,EventLoggingPriority,RetentiveValue,RetentiveAlarmParameters,AlarmValueDeadband,AlarmDevDeadband,EngUnits,InitialValue,MinEU,MaxEU,Deadband,LogDeadband,LoLoAlarmState,LoLoAlarmValue,LoLoAlarmPri,LoAlarmState,LoAlarmValue,LoAlarmPri,HiAlarmState,HiAlarmValue,HiAlarmPri,HiHiAlarmState,HiHiAlarmValue,HiHiAlarmPri,MinorDevAlarmState,MinorDevAlarmValue,MinorDevAlarmPri,MajorDevAlarmState,MajorDevAlarmValue,MajorDevAlarmPri,DevTarget,ROCAlarmState,ROCAlarmValue,ROCAlarmPri,ROCTimeBase,MinRaw,MaxRaw,Conversion,AccessName,ItemUseTagname,ItemName,ReadOnly,AlarmComment,AlarmAckModel,LoLoAlarmDisable,LoAlarmDisable,HiAlarmDisable,HiHiAlarmDisable,MinDevAlarmDisable,MajDevAlarmDisable,RocAlarmDisable,LoLoAlarmInhibitor,LoAlarmInhibitor,HiAlarmInhibitor,HiHiAlarmInhibitor,MinDevAlarmInhibitor,MajDevAlarmInhibitor,RocAlarmInhibitor,SymbolicName
that is all one line. and i am not sure what is what in there i gotta talk to the guy that wrote it to figure out what is going on in that one.
Last edited by GWilliams; 05-01-2009 at 04:04 PM.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks