Closed
Description
I am using CPPPO to simulate a PowerFlex 525. I am also using pycomm3 to craft the CIP Read/Write packets; (I found pycomm3 first). Pycomm3 has a CIP Discovery method, and it is able to see the simulated drive I created, but it seems to return 3 devices instead of 1
Screenshot of it happening:
My Simulated Drive Code:
import sys, logging
from Excel_Dump_Lables import Lables
from cpppo.server import enip
from cpppo.server.enip.main import main as enip_main
class DPI_Parameters( enip.Object ):
class_id = 0x93
def __init__( self, name=None, **kwds ):
super( DPI_Parameters, self ).__init__( name=name, **kwds )
if self.instance_id == 0:
pass
else:
self.attribute['9']= enip.Attribute( Lables[self.instance_id], enip.INT, default=self.instance_id )
def main( **kwds ):
enip.config_files += [ __file__.replace( '.py', '.cfg' ) ]
for x in range(1,731):
DPI_Parameters( name="DPI_Parameters", instance_id=x )
return enip_main( argv=sys.argv[1:])
sys.exit( main( attribute_class=main,argv=sys.argv[1:]))
Drive Config File:
[Identity]
Product Name = PowerFlex 525
[TCPIP]
Interface Status = 2 # (Hardware configured)
Configuration Capability = 48 # (Config Settable, Hardware Settable)
Configuration Control = 16 # Statically assigned IP, DNS Eanbled
Host Name = PowerFlexSimDrive
Path to Physical Link = [
{ "class": 246 },
{ "instance": 1 }
]
Interface Configuration = {
"ip_address": "192.168.1.143",
"gateway_address": "192.168.1.1",
"network_mask": "255.255.255.0",
"dns_primary": "1.1.1.1",
"dns_secondary": "8.8.8.8",
"domain_name": "example.com"
}
[UCMM]
"Route Path" = false
My Question: Is there a way to check that I am not accidentally spawning more than one drive process?
Or if there is something glaringly wrong with my code
Metadata
Metadata
Assignees
Labels
No labels