Jump to content
Sign in to follow this  
S1ack

General Help Indeed...a long-shot here....

Recommended Posts

TL;DR

OP has never used Delphi before. Been tasked with replacing circa 2000 Delphi 5 based HMI with an Ignition based system.

So, a mega lack of knowledge by the OP

 

For Nostalgia...?

image.thumb.png.0dce13c8d80dc10b74a98303b5e8d700.png

 

This HMI talks to an Omron PLC (programmable logic controller), which is on an ISA card in the WinNT machine, via a compiled C library *I think*.

Installing Delphi 5 on a fresh WinNT VM to examine forms etc.. I have Delphi throwing error dialogs upon opening what is the 'header' form, complaining about classes not found....

Classes not found: TParts, TDspItem, TDspChg, TTxEdit

 

Are these common things from back in the day? or Obscure?

I guess that's the immediate question - can I get this project to load forms without throwing errors?

 

 

Googling is not providing results. Or the signal to noise is low. 

Thought I'd ask here - if it appear to be what I think it is - an active forum for people who use Delphi or what Delphi has become in 2023.

 

I ran through the Delphi 5 install again thinking I'd select custom install and perhaps get lucky with some option to install what ever it is that makes Delph aware of those classes it's not. That was a bust - but there were some errors during the install about not being able to open install logs. And another about how I 

 

Why am I doing this? Biggest issue: Attempting to get a complete picture of all the data to/from the HMI and the PLC . Including access information like what is read only from the HMI and what is read/write.

Frankly I do not know if this is a worthwhile endeavor to figure out the mapping. But my other option is a heavy slog reverse engineering from the PLC side of things (learning curves attached with that, whereas the PLC logic was a few click conversion to a modern piece of hardware). 

 

 

I've been provided with all of the Delphi files by the customer, and have looked through them extensively, looking for definitive mapping of all the PLC memory areas that the HMI uses. This leads me to believe it's several hundred words in the 'DM' area. The MainSrc.pas file implies that the HMI calls functions to read write from an included library.

 

image.thumb.png.621609a3cca3de4d333634ca8efb0e81.png

 

image.thumb.png.b1d68d30ba43a1a8ca629a01f2ba8748.png

image.thumb.png.b16fdf6e0d69d21e31dc63bb60cb7f8b.png

 

I've reached out to Omron about doumentation for this TSysmac_C thing but they have not been helpful.

 

Occasionally there are ASCII files within sub folders (of the root folder that contains the Delphi project files) that do list PLC memory locations but my fear is that it's not complete. And it also suggest some multiplexing going on. Frequently these files do not have column names, so I though poking arond in Delphi 5 miht fill in those blanks.

 

image.thumb.png.717a5104722f2c9fc1a087291cfebef6.png

 

Lastly, at least I can color check things and make the new HMI look and feel like the old - (Which was requested).

 

 

Share this post


Link to post
51 minutes ago, S1ack said:

Classes not found: TParts, TDspItem, TDspChg, TTxEdit

These classes do not belong to Delphi, they will be defined in external units, that is, they are defined in some other file accessed by your project in Delphi5...

check all the units (.Pas files) inside the project folders. In Delphi you can ask it to search for some text in all project files, check the "Find in files..." option in the Edit menu, if it exists in Delphi5.

If they are found, then you need to add their path in the project settings -> Project, Options, --> Library Path...
This way, the compiler will be able to find and compile without errors.

Share this post


Link to post

Check the .dfm files by using a text editor. Most likely the classes you are looking were dropped on the form back in '97.  If so, you load those into IDE using package(s) *.dpks before opening the unit.pas   The unit's dfm loads with the {$rec *.dfm} directive in the implementation, or the classes could be loaded at runtime If available and pathed as p'2K mentions.  

 

I think I have an Omron under the bench somewhere but it uses a 232 port. Sorry.    

Pat

Edited by Pat Foley
It's an OTC sorry.

Share this post


Link to post

Thanks for the reply.

42 minutes ago, programmerdelphi2k said:

In Delphi you can ask it to search for some text in all project files, check the "Find in files..." option in the Edit menu, if it exists in Delphi5.

Did that. Finds many - declarations or definitions (like I said I'm a noob).

image.thumb.png.6ae33cc6c51a82be4e1fabc1b6a322ff.pngimage.thumb.png.10951498f98a47105181c88e93311584.png

 

 

28 minutes ago, programmerdelphi2k said:

If they are found, then you need to add their path in the project settings -> Project, Options, --> Library Path...
This way, the compiler will be able to find and compile without errors.

No Library path that I could see.

I added the root folder of the project to 'search path' hoping it's recursive. Saved and re-opened the header form. No luck.

image.png.f15c5738b0b876ec29c6e4144088637e.png

 

I'll be going to the customer tomorrow to fiddle with an NT system they have on life support as a backup HMI. 

Hopefully I'll observe the project in a more functioning manner than the the VM I am trying to create.

I asked the customer to search his hard drive for the SYSMAC item, and it hit on C:\ProgramFiles\Borland\Delphi5\Imports - I'll be looking at that. 

 

Share this post


Link to post
10 minutes ago, Pat Foley said:

Check the .dfm files by using a text editor. Most likely the classes you are looking were dropped on the form back in '97. 

Interesting.

OK. Lots of hits...

 

image.thumb.png.0920522162e3be51d6dcd92865852f51.png

 

13 minutes ago, Pat Foley said:

If so, you load those into IDE using package(s) *.dpks before opening the unit.pas   The unit's dfm loads with the {$rec *.dfm} directive in the implementation, or the classes could be loaded at runtime If available and pathed as p'2K mentions.  

Does the above hits 'make it so'? i.e. your 'dropped on the form' is what happened.

 

I am clueless about the package *dpks means I should do.  At first I thought you were implying that the classes I'm looking for are there inside the form. But that seems strange. Now I'm thinking it's just another means of adding it to the project - drag and dropped onto the form when under construction. Which assumes I'd still need the source of the class(es) Delphi cannot find.

 

Share this post


Link to post
8 minutes ago, S1ack said:

Does the above hits 'make it so'? i.e. your 'dropped on the form' is what happened.

Yes, but it appears that the dfm was saved in binary.  Reading in text editor is enhanced when saving dfm as text. 

 

Besides the standard TButton and TControls like VB, Delphi user could build or be provided a custom Control to drop on form (even nonvisual controls). The package or library is *.dpk that puts the Control on the rail and registers the control so IDE "knows" what is dropped in design window.  These components are streamed in and their events connected at runtime.

Share this post


Link to post
1 hour ago, S1ack said:

Did that. Finds many - declarations or definitions (like I said I'm a noob).

You need find "WHERE" the TParts class is defined... not where it is used!!!

for example:

  • any class is defined like this:      Txxxxxx = class( .... )....

then, you need find "what unit (Pas file) is defining your class desired, in case  "TParts"

then, you can put the path (c:\xxxx\xxxx) folder on "Search Path", for example.

 

TIP: look at "USES" clause and see the unit names... maybe you can find a peculiar name... like,  uMyParts  -- you understand? not necessary this name of course!

Edited by programmerdelphi2k

Share this post


Link to post
1 hour ago, S1ack said:

I asked the customer to search his hard drive for the SYSMAC item, and it hit on C:\ProgramFiles\Borland\Delphi5\Imports - I'll be looking at that. 

Files in the Imports directory have been generated by the type library importer (generated pascal wrappers around COM libraries). This most likely means that some of the missing controls (e.g. the TSYSMAC_C control) are ActiveX controls. Probably ActiveX controls that were provided by Omrom for communication with the device.

Googling for SYSMAC_C Omrom leads to a few hits. Notably, one that mentions a Sysmac_C ActiveX control.

 

TTxEdit sounds like a custom edit control. Googling for Delphi TTxEdit lead me to a Korean message board with a message from 2007 with this link: ftp://ftp.nsk.su/pub/msdos/misc/ttxedit.arj
Unfort
unately, that site is long gone.

You can probably replace the TTxEdit control with TEdit.

Share this post


Link to post

I don't think you'll fix that easily, those components were part of communication packages that no longer exist.

 

They were imported from ActiveX (Omron never supplied wrappers in Delphi, I'm going by memory) registered either as integrated communication packages or separate components.

The CX_ServerLite and CX_Compolet components are currently available but they absolutely do not support the WINNT environment.

 

If you don't have the components installed in your VM or you don't have the Type Libraries or ActiveX wrappers (*_TLB.pas), you can't do anything with Delphi.

It is probable that to install the components in your WM, even if you could find them, you would need the SYSMAC_BOARD drivers (I think you are referring to a C200PC-ISA1 PLC, it's the only one I remember ever seeing).

 

If you have the original PC available you could theoretically recreate all the wrappers from the installed ActiveX. Not an easy job but doable.

But first check if you have *_TLB.PAS files somewhere, like in the IMPORTS sub-directory of DELPHI5 (in the original source, from the customer, ....): If "Yes" you can copy in your WM, register them and load all the FORMS.

 

Bye

 

P.S.: may be also if you have the *_TLB.pas files registered, some parts of the Form will not be design correctly if you don't have the components installed (normally they are DLL or EXE or OCX in that time).

Edited by DelphiUdIT

Share this post


Link to post

BTW - when searching in files, use "in directories" and check "Include subdirectories" and point to the topmost folder that contains your source code.

"In projects" does not necessarily include all units, since you can reference a unit without adding it to the project.

Share this post


Link to post

Hi.

Try to use "Total commander" and search for *.pas files which contain text e.g. "TDspItem"

 

 

Schránka 01.jpg

Share this post


Link to post

Thank you all for the replies.

 

14 hours ago, DelphiUdIT said:

I don't think you'll fix that easily, those components were part of communication packages that no longer exist.

 

They were imported from ActiveX (Omron never supplied wrappers in Delphi, I'm going by memory) registered either as integrated communication packages or separate components.

The CX_ServerLite and CX_Compolet components are currently available but they absolutely do not support the WINNT environment.

 

If you don't have the components installed in your VM or you don't have the Type Libraries or ActiveX wrappers (*_TLB.pas), you can't do anything with Delphi.

It is probable that to install the components in your WM, even if you could find them, you would need the SYSMAC_BOARD drivers (I think you are referring to a C200PC-ISA1 PLC, it's the only one I remember ever seeing).

 

If you have the original PC available you could theoretically recreate all the wrappers from the installed ActiveX. Not an easy job but doable.

But first check if you have *_TLB.PAS files somewhere, like in the IMPORTS sub-directory of DELPHI5 (in the original source, from the customer, ....): If "Yes" you can copy in your WM, register them and load all the FORMS.

 

Bye

 

P.S.: may be also if you have the *_TLB.pas files registered, some parts of the Form will not be design correctly if you don't have the components installed (normally they are DLL or EXE or OCX in that time).

 

I realize it's long shot. And I'm starting to believe it's not worth the trouble vs my other option of reverse engineering from the PLC. Only problem with that is comments in the PLC (they did not use symbols/names of the addresses) may not have a high correlation with the names in Delphi / on the screens.

 

Yes, PLC is/was a C200PC-ISA13-DRM

 

SYSMAC: Customer supposedly has all the original disks. This is their routine when they rebuild the WinNT...

 

Quote

 

1.      Install Win NT 4.0 with service pack 6A High Encryption Pack (NTFS file system).

2.      Install MDAC 2 SP1 (Microsoft Data Access Components such as ODMC, OLE)

3.      Install backup copy of Ulvac software (\NLD6000 and \UlvacStd folders).

4.      Install Omron FinsGateway ver 2.0 (allows communication between Omron and Microsoft Windows programs)
       and install Omron Sysmac Compolet 2.0 (Omron network used to communicate with the PLC).

5.      Go to Program Files-> FinsGateway Service Manager. Set the property of the 2 files running:
       CPU and Sysmac board units from manual to auto and start.

6.      Install Borland Delphi software (may not be needed). Ulvac software written using this program.

7.      Copy ShardMem.dll file from \UlvacStd\Dll folder to \Windows\System32 folder.

8.      Add shortcut to desktop for Ulvac software start-up.
       Use C\NLD6000\Main\Mserver.exe C:\Nld6000  for target.

 

 

I asked if I could image those install disks and they are going to oblige.

If not having the board causes problems with rendering the HMI or opening forms (assuming I get the missing classes issue fixed) well then I'm out of luck.

 

Share this post


Link to post
23 minutes ago, S1ack said:

If not having the board causes problems with rendering the HMI or opening forms (assuming I get the missing classes issue fixed) well then I'm out of luck.

I have never used Omron components (although I have been a direct customer of Omron for more than twenty years) because I developed my own series of components, starting from the communication protocols.

This is because I had to develop applications that already used fiber optics before the 90s and Omron didn't have high-performance components at that time (let's just say it didn't have components...).

 

However, I managed to find in my archives the COMPOLET 2.0 (year 2003) and they are for WINNT3 SP3 or Higher.

 

If you want I can send to you a private message with link (on my server) to download them. If you are able to install these, with Delphi 5 you can extract the TLBs.

I don't know if something else (e.g. FINS GW) is needed to install them (I hope not).

 

Bye

Share this post


Link to post

So, I went to the customer yesterday and had success.

 

On my VM I can now open forms without error, and most importantly see the PLC addresses within the object inspector. Which was my goal.

 

image.thumb.png.2fc0f2b2f372b40f824b9f2b9f880ab7.png

 

 

blah, blah, blah...

They had setup the Windows NT machine with a network share to an XP machine so I could move files off on as needed.

 

In my limited knowledge hind sight, the issue, as many of you tried to point out was my VM installation did not have packages / components installed. I managed to do that yesterday. If somewhat clumsily stumbling into a positive result.

The machine's OEM had apparently developed standard components in Delphi. Where the project files were all contained within folder \NLD6000 (the machine model) there was another folder \UlvacStd that had a \cmp subfolder filled with .pas, and .dcu files.

I had this already, but copied it again to the VM, initially I naively tried to just add the path to libs tab under menu Tools | Environment Options  . Did not work.

Looking at the Windows NT machine the components were inserted into dclusr50.

On the VM I tried to insert them all - selected all *.dcu - and install failed. Tried again selected all *.pas - install failed but looked much better than before with hints, warnings, and errors being reported. So I deleted all components that it errored on, and continued trying to install. Did not work.

 

Brute force back door clutching at straws: I removed C:\Program Files\Delphi5 from the VM, and replaced it with the same from the Windows NT machine. Bad Idea. Replaced original Delphi5 folder, then copied the Windows NT \Delphi5 onto it selecting to overwrite all. Then when Delphi next launched (complaining about unlicensed modules), I selected ONLY the (4) .pas files that corresponded to the (4) class names the form I originally tried to open complained about. There was a logner list than (4) things in a tree structure dialog, which I took as it bringing along dependancies?

 

In any case, this time it all installed without error, and boom I had a new palette.

 

Hot damn tamale.

 

 

21 hours ago, DelphiUdIT said:

However, I managed to find in my archives the COMPOLET 2.0 (year 2003) and they are for WINNT3 SP3 or Higher.

 

If you want I can send to you a private message with link (on my server) to download them. If you are able to install these, with Delphi 5 you can extract the TLBs.

I don't know if something else (e.g. FINS GW) is needed to install them (I hope not).

 

 

Thank you very much but that will not be necessary, I have .iso images of Compolet, and FINS gateway CDs that the customer had.

Share this post


Link to post

More general questions...

Is it obvious to veteran Delphi users that this TDspItem is using the Bit1-BitAlarm properties to select a color for the button/panel? Because that's what I'd assume looking at it.

Is it a one-for-one bit-to-color mapping? or are the bits enumerated to an int to select the color.

 

Here 4 bits could do 16 colors, but there are only 9 colors for the control.

 

image.thumb.png.ac0a69756e03b8d22c5240e829fc6e00.png

 

Here 2 bits and 4 colors which implies an integer selects the color.

image.thumb.png.3aa0fcd6d577fd108c269934a1c1af9a.png

 

Or is that a stupid question and the controls are different so the action could be different. One would have to look at the source.

The most likely answer. I suppose. Unfortunately 1 semester of Pascal in 1989 - and I am not sure I am up to that task.

I've looked at it and I get the feeling that the bits are resolved to an integer and that sets the color.

 

I could post the source, unless that is against the rules.

 

 

 

 

 

 

 

Edited by S1ack

Share this post


Link to post
15 minutes ago, S1ack said:

More general questions...

Is it obvious to veteran Delphi users that this TDspItem is using the Bit1-BitAlarm properties to select a color for the button/panel? Because that's what I'd assume looking at it.

Is it a one-for-one bit-to-color mapping? or are the bits enumerated to an int to select the color.

  

Here 4 bits could do 16 colors, but there are only 9 colors for the control.

It is one-to-one color mapping, means the every 8 DI+ BitAlarm are assigned the a Color0-Color7 + ColorA(larm). Graphically, I don't know if the control provides for the possibility of displaying all 9 states at the same time.

Share this post


Link to post

I suppose the D5 copy is the owner's.  My concern are the gas trains meeting ASME codes for the interlocks to work properly.*  I been in a plant where an intern changed the overall 16 color scheme and some things quit working.  This image is marked up with where to click at to bring the color property editor. Also a text box shows effect of copying a shape control and pasting it into a text editor. 

* Not jumper wired or modified to prevent Tripping.

Screenshot 2023-04-06 141110.png

Share this post


Link to post
On 4/6/2023 at 2:47 PM, DelphiUdIT said:

It is one-to-one color mapping, means the every 8 DI+ BitAlarm are assigned the a Color0-Color7 + ColorA(larm). Graphically, I don't know if the control provides for the possibility of displaying all 9 states at the same time.

So you are sure about this. I have looked as the source - bit my lack of experience is not helping.

I can do that in Ignition with scripting but it's more involved that the other option.

 

 

I sorta see it if I follow the 'FBit' which I take to be the Formbits i.e. the bits passed form the form (as seen in the object inspector) to the control source as Bits0-8. But I probably have that terminology mutilated somewhat.

 

image.png.8aea09d59257cfb2c1df5df59d697555.png

 

image.thumb.png.c519ead3da5e660339afa382ff252bd2.png

 

image.png.7f9cad469025f25057158da793d6dd63.png

 

Here it looks like the individual bits, if set are then setting a value to the equivalent integer of the bit positition.

 

image.thumb.png.6c69628973bcc54a56291fd1fae3da2e.png

 

If I follow FColor with the same assumption that it's the colors as seen in the object inspector....

image.png.68c393a7c2c55baaf48123bc75a23ad2.png

 

image.thumb.png.91ef162fac8bf036da9822cf317c0162.png

 

Towards the bottom is what looks where the colors are set...

image.thumb.png.02536b869a762f17f163228e827bb6a4.png

 

But I really have no clue how the Fbits are tied to the Fcolor. There seem to be myriad uses of 'value' in between the two, But like I said. I'm a noob.

 

I attached the source .pas. 

 

 

 

 

 

 

 

 

image.png

DspItem.pas

Share this post


Link to post
On 4/6/2023 at 3:58 PM, Pat Foley said:

I suppose the D5 copy is the owner's.  My concern are the gas trains meeting ASME codes for the interlocks to work properly.*  I been in a plant where an intern changed the overall 16 color scheme and some things quit working.  This image is marked up with where to click at to bring the color property editor. Also a text box shows effect of copying a shape control and pasting it into a text editor. 

* Not jumper wired or modified to prevent Tripping.

Screenshot 2023-04-06 141110.png

>My concern are the gas trains meeting ASME codes for the interlocks to work properly.*

Doubtful, OEM is Japan based. 

It's not a plant, it's a plasma etching machine. Etches semiconductor / optical wafers used in fiber optic comms or so I am told.

 

> This image is marked up with where to click at to bring the color property editor.

OK, not sure what to do with that information.

This is from my NT VM...

 

image.png.bbf529f1fadb9c51215f7ec21695be60.png

 

>Also a text box shows effect of copying a shape control and pasting it into a text editor. 

OK, also not sure what to do with that.

 

 

Share this post


Link to post
12 hours ago, S1ack said:

But I really have no clue how the Fbits are tied to the Fcolor.

 

The color value (for example clAcqua) is matched to the input (status or value).


Color, other than visual meaning, has no effect on the code (it shouldn't).


Typically those controls were designed and used as a "level": the highest value "won" over the others and that was the state (color) displayed.

The component is closely linked to the hardware (PLC), it must be thought of as a representation of the state and the PLC vice versa must be programmed to coherently represent the state.

If not, you need to build your own component and/or derive from an existing one by overriding the methods.

 

Bye

 

P.S.

To better specify, the component could work like this:
the displayed color is represented by the highest active bit in Bit1, Bit2, Bit3 ..... etc., if more bits are active the highest one "wins", but typically ONLY one of these should be active.;
the alarm bit has priority over all and if active the component will display the matched colour.

Edited by DelphiUdIT

Share this post


Link to post
11 hours ago, S1ack said:

There seem to be myriad uses of 'value' in between the two, But like I said. I'm a noob.

That "variable" (Value) is not a global variable but a local one. It is in fact a different "object" in each single procedure.
Very often these variables are automatically generated by component imports such as COM objects or wrapper or getter/setter generators.
However, it is a standard acquired by programmers to use for example "Value" as a generic input datum in a procedure / function / method.

 

Share this post


Link to post
On 4/12/2023 at 3:53 PM, S1ack said:

OK, also not sure what to do with that.

  • Still should follow National Fire Code and National Electric Codes. 
  • Should able to type in a desired color number vs messing with editor.
  • Copying controls off the design screen into Notepad++ allows an easy compare of contents.

    The coloring of the controls was changed when a door interlock was added which caused the original 20 displays to lose their ability to reflect the status. The added control's status colors magic numbers were used to code the status color value somewhat then status color changes were commented out for original displays. Reverting to original intent colors reflecting status for all depictions could readily implemented.  

   Attached shows Two of Tee's added following their status settings all the controls are having their Color0 set. I added a diamond and alert kind. 

Pat

displayapp_4YvDlxOa2d.gif

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×