Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[KNOWN ISSUE] Bulk request over WebAPI is limited to 64kB #82

Merged
merged 2 commits into from
Feb 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/ix.compiler/src/ixc/Properties/launchSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"profiles": {
"ixc": {
"commandName": "Project",
"workingDirectory": "c:\\W\\Develop\\gh\\ix-ax\\ix\\src\\tests.integrations\\integrated\\src\\ax\\"
"workingDirectory": "c:\\W\\Develop\\gh\\ix-ax\\ix.framework.app.templates\\working\\templates\\ax\\"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ namespace Ix.Connector.S71500.WebApi;

internal interface IWebApiPrimitive : ITwinPrimitive
{
ApiPlcReadRequest PeekPlcReadRequestData { get; }

ApiPlcWriteRequest PeekPlcWriteRequestData { get; }

ApiPlcReadRequest PlcReadRequestData { get; }
ApiPlcWriteRequest PlcWriteRequestData { get; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,35 @@ public WebApiBool(ITwinObject parent,
_webApiConnector = WebApiConnector.Cast(parent.GetConnector());
}

private ApiPlcWriteRequest _plcWriteRequestData;
private ApiPlcReadRequest _plcReadRequestData;

/// <inheritdoc />
ApiPlcReadRequest IWebApiPrimitive.PeekPlcReadRequestData => _plcReadRequestData ?? WebApiConnector.CreateReadRequest(Symbol, _webApiConnector.DBName);

/// <inheritdoc />
ApiPlcReadRequest IWebApiPrimitive.PlcReadRequestData =>
WebApiConnector.CreateReadRequest(Symbol, _webApiConnector.DBName);
ApiPlcWriteRequest IWebApiPrimitive.PeekPlcWriteRequestData => _plcWriteRequestData ?? WebApiConnector.CreateWriteRequest(Symbol, CyclicToWrite, _webApiConnector.DBName);

/// <inheritdoc />
ApiPlcWriteRequest IWebApiPrimitive.PlcWriteRequestData =>
WebApiConnector.CreateWriteRequest(Symbol, CyclicToWrite, _webApiConnector.DBName);
ApiPlcReadRequest IWebApiPrimitive.PlcReadRequestData
{
get
{
_plcReadRequestData = WebApiConnector.CreateReadRequest(Symbol, _webApiConnector.DBName);
return _plcReadRequestData;
}

}

/// <inheritdoc />
ApiPlcWriteRequest IWebApiPrimitive.PlcWriteRequestData
{
get
{
_plcWriteRequestData = WebApiConnector.CreateWriteRequest(Symbol, CyclicToWrite, _webApiConnector.DBName);
return _plcWriteRequestData;
}
}

/// <inheritdoc />
public void Read(string value)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,35 @@ public WebApiByte()
_webApiConnector = new WebApiConnector();
}

private ApiPlcWriteRequest _plcWriteRequestData;
private ApiPlcReadRequest _plcReadRequestData;

/// <inheritdoc />
ApiPlcReadRequest IWebApiPrimitive.PeekPlcReadRequestData => _plcReadRequestData ?? WebApiConnector.CreateReadRequest(Symbol, _webApiConnector.DBName);

/// <inheritdoc />
ApiPlcWriteRequest IWebApiPrimitive.PeekPlcWriteRequestData => _plcWriteRequestData ?? WebApiConnector.CreateWriteRequest(Symbol, CyclicToWrite, _webApiConnector.DBName);

/// <inheritdoc />
ApiPlcReadRequest IWebApiPrimitive.PlcReadRequestData =>
WebApiConnector.CreateReadRequest(Symbol, _webApiConnector.DBName);
ApiPlcReadRequest IWebApiPrimitive.PlcReadRequestData
{
get
{
_plcReadRequestData = WebApiConnector.CreateReadRequest(Symbol, _webApiConnector.DBName);
return _plcReadRequestData;
}

}

/// <inheritdoc />
ApiPlcWriteRequest IWebApiPrimitive.PlcWriteRequestData =>
WebApiConnector.CreateWriteRequest(Symbol, CyclicToWrite, _webApiConnector.DBName);
ApiPlcWriteRequest IWebApiPrimitive.PlcWriteRequestData
{
get
{
_plcWriteRequestData = WebApiConnector.CreateWriteRequest(Symbol, CyclicToWrite, _webApiConnector.DBName);
return _plcWriteRequestData;
}
}

/// <inheritdoc />
public void Read(string result)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,40 @@ public WebApiChar()
_webApiConnector = new WebApiConnector();
}

private ApiPlcWriteRequest _plcWriteRequestData;
private ApiPlcReadRequest _plcReadRequestData;

/// <inheritdoc />
ApiPlcReadRequest IWebApiPrimitive.PeekPlcReadRequestData => _plcReadRequestData ?? WebApiConnector.CreateReadRequest(Symbol, _webApiConnector.DBName);

/// <inheritdoc />
ApiPlcReadRequest IWebApiPrimitive.PlcReadRequestData =>
WebApiConnector.CreateReadRequest(Symbol, _webApiConnector.DBName);
ApiPlcWriteRequest IWebApiPrimitive.PeekPlcWriteRequestData => _plcWriteRequestData ?? WebApiConnector.CreateWriteRequest(Symbol, CyclicToWrite, _webApiConnector.DBName);

/// <inheritdoc />
ApiPlcWriteRequest IWebApiPrimitive.PlcWriteRequestData =>
WebApiConnector.CreateWriteRequest(Symbol, CyclicToWrite, _webApiConnector.DBName);
ApiPlcReadRequest IWebApiPrimitive.PlcReadRequestData
{
get
{
_plcReadRequestData = WebApiConnector.CreateReadRequest(Symbol, _webApiConnector.DBName);
return _plcReadRequestData;
}

}

private char AdjustToValueValue(char value)
{
return (char)(value < 0x0020 || value > 0x007F ? 0x0020 : value);
}

/// <inheritdoc />
ApiPlcWriteRequest IWebApiPrimitive.PlcWriteRequestData
{
get
{
_plcWriteRequestData = WebApiConnector.CreateWriteRequest(Symbol, AdjustToValueValue(CyclicToWrite), _webApiConnector.DBName);
return _plcWriteRequestData;
}
}

/// <inheritdoc />
public void Read(string value)
Expand All @@ -54,6 +81,6 @@ public override async Task<char> GetAsync()
/// <inheritdoc />
public override async Task<char> SetAsync(char value)
{
return await _webApiConnector.WriteAsync(this, value);
return await _webApiConnector.WriteAsync(this, AdjustToValueValue(value));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,35 @@ public WebApiDInt(ITwinObject parent,
_webApiConnector = WebApiConnector.Cast(parent.GetConnector());
}

private ApiPlcWriteRequest _plcWriteRequestData;
private ApiPlcReadRequest _plcReadRequestData;

/// <inheritdoc />
ApiPlcReadRequest IWebApiPrimitive.PlcReadRequestData =>
WebApiConnector.CreateReadRequest(Symbol, _webApiConnector.DBName);
ApiPlcReadRequest IWebApiPrimitive.PeekPlcReadRequestData => _plcReadRequestData ?? WebApiConnector.CreateReadRequest(Symbol, _webApiConnector.DBName);

/// <inheritdoc />
ApiPlcWriteRequest IWebApiPrimitive.PlcWriteRequestData =>
WebApiConnector.CreateWriteRequest(Symbol, CyclicToWrite, _webApiConnector.DBName);
ApiPlcWriteRequest IWebApiPrimitive.PeekPlcWriteRequestData => _plcWriteRequestData ?? WebApiConnector.CreateWriteRequest(Symbol, CyclicToWrite, _webApiConnector.DBName);

/// <inheritdoc />
ApiPlcReadRequest IWebApiPrimitive.PlcReadRequestData
{
get
{
_plcReadRequestData = WebApiConnector.CreateReadRequest(Symbol, _webApiConnector.DBName);
return _plcReadRequestData;
}

}

/// <inheritdoc />
ApiPlcWriteRequest IWebApiPrimitive.PlcWriteRequestData
{
get
{
_plcWriteRequestData = WebApiConnector.CreateWriteRequest(Symbol, CyclicToWrite, _webApiConnector.DBName);
return _plcWriteRequestData;
}
}

/// <inheritdoc />
public void Read(string value)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,35 @@ public WebApiDWord(ITwinObject parent,
_webApiConnector = WebApiConnector.Cast(parent.GetConnector());
}

private ApiPlcWriteRequest _plcWriteRequestData;
private ApiPlcReadRequest _plcReadRequestData;

/// <inheritdoc />
ApiPlcReadRequest IWebApiPrimitive.PeekPlcReadRequestData => _plcReadRequestData ?? WebApiConnector.CreateReadRequest(Symbol, _webApiConnector.DBName);

/// <inheritdoc />
ApiPlcWriteRequest IWebApiPrimitive.PeekPlcWriteRequestData => _plcWriteRequestData ?? WebApiConnector.CreateWriteRequest(Symbol, CyclicToWrite, _webApiConnector.DBName);

/// <inheritdoc />
ApiPlcReadRequest IWebApiPrimitive.PlcReadRequestData =>
WebApiConnector.CreateReadRequest(Symbol, _webApiConnector.DBName);
ApiPlcReadRequest IWebApiPrimitive.PlcReadRequestData
{
get
{
_plcReadRequestData = WebApiConnector.CreateReadRequest(Symbol, _webApiConnector.DBName);
return _plcReadRequestData;
}

}

/// <inheritdoc />
ApiPlcWriteRequest IWebApiPrimitive.PlcWriteRequestData =>
WebApiConnector.CreateWriteRequest(Symbol, CyclicToWrite, _webApiConnector.DBName);
ApiPlcWriteRequest IWebApiPrimitive.PlcWriteRequestData
{
get
{
_plcWriteRequestData = WebApiConnector.CreateWriteRequest(Symbol, CyclicToWrite, _webApiConnector.DBName);
return _plcWriteRequestData;
}
}

/// <inheritdoc />
public void Read(string value)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,35 @@ public WebApiDate(ITwinObject parent,
_webApiConnector = WebApiConnector.Cast(parent.GetConnector());
}

private ApiPlcWriteRequest _plcWriteRequestData;
private ApiPlcReadRequest _plcReadRequestData;

/// <inheritdoc />
ApiPlcReadRequest IWebApiPrimitive.PlcReadRequestData =>
WebApiConnector.CreateReadRequest(Symbol, _webApiConnector.DBName);
ApiPlcReadRequest IWebApiPrimitive.PeekPlcReadRequestData => _plcReadRequestData ?? WebApiConnector.CreateReadRequest(Symbol, _webApiConnector.DBName);

/// <inheritdoc />
ApiPlcWriteRequest IWebApiPrimitive.PlcWriteRequestData =>
WebApiConnector.CreateWriteRequest(Symbol, GetFromDate(CyclicToWrite), _webApiConnector.DBName);
ApiPlcWriteRequest IWebApiPrimitive.PeekPlcWriteRequestData => _plcWriteRequestData ?? WebApiConnector.CreateWriteRequest(Symbol, CyclicToWrite, _webApiConnector.DBName);

/// <inheritdoc />
ApiPlcReadRequest IWebApiPrimitive.PlcReadRequestData
{
get
{
_plcReadRequestData = WebApiConnector.CreateReadRequest(Symbol, _webApiConnector.DBName);
return _plcReadRequestData;
}

}

/// <inheritdoc />
ApiPlcWriteRequest IWebApiPrimitive.PlcWriteRequestData
{
get
{
_plcWriteRequestData = WebApiConnector.CreateWriteRequest(Symbol, GetFromDate(CyclicToWrite), _webApiConnector.DBName);
return _plcWriteRequestData;
}
}

/// <inheritdoc />
public void Read(string value)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,35 @@ public WebApiDateTime(ITwinObject parent,
_webApiConnector = WebApiConnector.Cast(parent.GetConnector());
}

private ApiPlcWriteRequest _plcWriteRequestData;
private ApiPlcReadRequest _plcReadRequestData;

/// <inheritdoc />
ApiPlcReadRequest IWebApiPrimitive.PlcReadRequestData =>
WebApiConnector.CreateReadRequest(Symbol, _webApiConnector.DBName);
ApiPlcReadRequest IWebApiPrimitive.PeekPlcReadRequestData => _plcReadRequestData ?? WebApiConnector.CreateReadRequest(Symbol, _webApiConnector.DBName);

/// <inheritdoc />
ApiPlcWriteRequest IWebApiPrimitive.PlcWriteRequestData =>
WebApiConnector.CreateWriteRequest(Symbol, GetFromDate(CyclicToWrite), _webApiConnector.DBName);
ApiPlcWriteRequest IWebApiPrimitive.PeekPlcWriteRequestData => _plcWriteRequestData ?? WebApiConnector.CreateWriteRequest(Symbol, CyclicToWrite, _webApiConnector.DBName);

/// <inheritdoc />
ApiPlcReadRequest IWebApiPrimitive.PlcReadRequestData
{
get
{
_plcReadRequestData = WebApiConnector.CreateReadRequest(Symbol, _webApiConnector.DBName);
return _plcReadRequestData;
}

}

/// <inheritdoc />
ApiPlcWriteRequest IWebApiPrimitive.PlcWriteRequestData
{
get
{
_plcWriteRequestData = WebApiConnector.CreateWriteRequest(Symbol, GetFromDate(CyclicToWrite), _webApiConnector.DBName);
return _plcWriteRequestData;
}
}

/// <inheritdoc />
public void Read(string value)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,35 @@ public WebApiInt(ITwinObject parent,
_webApiConnector = WebApiConnector.Cast(parent.GetConnector());
}

private ApiPlcWriteRequest _plcWriteRequestData;
private ApiPlcReadRequest _plcReadRequestData;

/// <inheritdoc />
ApiPlcReadRequest IWebApiPrimitive.PeekPlcReadRequestData => _plcReadRequestData ?? WebApiConnector.CreateReadRequest(Symbol, _webApiConnector.DBName);

/// <inheritdoc />
ApiPlcWriteRequest IWebApiPrimitive.PeekPlcWriteRequestData => _plcWriteRequestData ?? WebApiConnector.CreateWriteRequest(Symbol, CyclicToWrite, _webApiConnector.DBName);

/// <inheritdoc />
ApiPlcReadRequest IWebApiPrimitive.PlcReadRequestData =>
WebApiConnector.CreateReadRequest(Symbol, _webApiConnector.DBName);
ApiPlcReadRequest IWebApiPrimitive.PlcReadRequestData
{
get
{
_plcReadRequestData = WebApiConnector.CreateReadRequest(Symbol, _webApiConnector.DBName);
return _plcReadRequestData;
}

}

/// <inheritdoc />
ApiPlcWriteRequest IWebApiPrimitive.PlcWriteRequestData =>
WebApiConnector.CreateWriteRequest(Symbol, CyclicToWrite, _webApiConnector.DBName);
ApiPlcWriteRequest IWebApiPrimitive.PlcWriteRequestData
{
get
{
_plcWriteRequestData = WebApiConnector.CreateWriteRequest(Symbol, CyclicToWrite, _webApiConnector.DBName);
return _plcWriteRequestData;
}
}

/// <inheritdoc />
public void Read(string value)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,35 @@ public WebApiLDate(ITwinObject parent,
_webApiConnector = WebApiConnector.Cast(parent.GetConnector());
}

private ApiPlcWriteRequest _plcWriteRequestData;
private ApiPlcReadRequest _plcReadRequestData;

/// <inheritdoc />
ApiPlcReadRequest IWebApiPrimitive.PlcReadRequestData =>
WebApiConnector.CreateReadRequest(Symbol, _webApiConnector.DBName);
ApiPlcReadRequest IWebApiPrimitive.PeekPlcReadRequestData => _plcReadRequestData ?? WebApiConnector.CreateReadRequest(Symbol, _webApiConnector.DBName);

/// <inheritdoc />
ApiPlcWriteRequest IWebApiPrimitive.PlcWriteRequestData =>
WebApiConnector.CreateWriteRequest(Symbol, GetFromDate(CyclicToWrite), _webApiConnector.DBName);
ApiPlcWriteRequest IWebApiPrimitive.PeekPlcWriteRequestData => _plcWriteRequestData ?? WebApiConnector.CreateWriteRequest(Symbol, CyclicToWrite, _webApiConnector.DBName);

/// <inheritdoc />
ApiPlcReadRequest IWebApiPrimitive.PlcReadRequestData
{
get
{
_plcReadRequestData = WebApiConnector.CreateReadRequest(Symbol, _webApiConnector.DBName);
return _plcReadRequestData;
}

}

/// <inheritdoc />
ApiPlcWriteRequest IWebApiPrimitive.PlcWriteRequestData
{
get
{
_plcWriteRequestData = WebApiConnector.CreateWriteRequest(Symbol, GetFromDate(CyclicToWrite), _webApiConnector.DBName);
return _plcWriteRequestData;
}
}

public void Read(string value)
{
Expand Down
Loading