Our company is in the process of migrating from Plexos V8.3 to V9.2 and I'm rewriting some of our API tools to work with V9. One issue I'm running into is on the function cxn.GenRunIndexes(). Here is my code:
`server = 'server#'
port = int('port#')
username = 'username'
password = 'password'
#Connect to server
cxn = plx.PLEXOSConnect()
cxn.DisplayAlerts = False
cxn.Connection('Data Source={}:{};User Id={};Password={}'.format(server,port,username,password))
#Get list of each run in Plexos Connect
cxn.GetRunIndexes(str(datetime(2022,1,1)),str(datetime.today()))`
The last line (cxn.GetRunIndexes) produces the following error:
---> 13 cxn.GetRunIndexes(str(datetime(2022,1,1)),str(datetime.today()))
IOException: PLEXOS API Error: Error trying to get Run indexes. Object reference not set to an instance of an object.
at PLEXOS_NET.Core.Base.ThrowError(String strException, Exception ex)
at PLEXOS_NET.Core.PLEXOSConnect.GetRunIndexes(String strTimeFrom, String strTimeTo)
I should note that this code works in the V8 API and I've tried several different string time formats to no avail.
Our company is in the process of migrating from Plexos V8.3 to V9.2 and I'm rewriting some of our API tools to work with V9. One issue I'm running into is on the function cxn.GenRunIndexes(). Here is my code:
`server = 'server#'
port = int('port#')
username = 'username'
password = 'password'
#Connect to server
cxn = plx.PLEXOSConnect()
cxn.DisplayAlerts = False
cxn.Connection('Data Source={}:{};User Id={};Password={}'.format(server,port,username,password))
#Get list of each run in Plexos Connect
cxn.GetRunIndexes(str(datetime(2022,1,1)),str(datetime.today()))`
The last line (cxn.GetRunIndexes) produces the following error:
I should note that this code works in the V8 API and I've tried several different string time formats to no avail.