Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
This method starts the TCP/IP socket server at a specified port.
int _stdcall icsneoStartSockServer(int hObject, int iPort);Public Declare Function icsneoStartSockServer Lib “icsneo40.dll” (ByVal hObject As Integer, ByVal iPort As Integer) As Integer[DllImport(“icsneo40.dll”)] public static extern int icsneoStartSockServer(int hObject, int iPort);Parameters
hObject
[in] Handle which specifies the driver object created by OpenNeoDevice
iPort
[in] specifies the TCP/IP Port where the server will be established.
Return Values
If the server was started successfully the return value will be non-zero.
Remarks
This method creates a TCP/IP server in the DLL. This server can be attached to by any TCP/IP clients using the RAW API or using the DLL by specifying TCP/IP with OpenNeoDevice. Only one server is allowed at a time.
icsneoStartSockServer(hObject, iPort);bStatus = icsneoStartSockServer(m_hObject, iPort)) '// start the socket serveriStatus = icsNeoDll.icsneoStartSockServer(m_hObject, Convert.ToInt32(txtServerPort.Text));This method is used to determine if a driver object is valid.
int _stdcall icsneoValidateHObject(void * hObject);Public Declare Function icsneoValidateHObject Lib “icsneo40.dll” (ByVal hObject As IntPtr) As Integer[DllImport(“icsneo40.dll”)] public static extern int icsneoValidateHObject(IntPtr hObject);Parameters
hObject
[in] Specifies the driver object created by OpenNeoDevice.
Return Values
1 if the hObject is valid. 0 if the object is invalid.
Remarks
A driver object will be invalid if it was never initialized by OpenNeoDevice. Calling ClosePort will not invalidate a driver object; only FreeObject will do so.
if(Convert::ToBoolean(icsneoValidateHObject(m_hObject)))
{
cmdCheckHardwareHandle->Text = "Good";
}
else
{
cmdCheckHardwareHandle->Text = "Lost";
}if (Convert.ToBoolean (icsNeoDll.icsneoValidateHObject(m_hObject)))
{
cmdCheckHardwareHandle.Text = "Good";
}
else
{
cmdCheckHardwareHandle.Text = "Lost";
}If (CBool(icsneoValidateHObject(m_hObject))) Then
cmdCheckHardwareHandle.Text = "Good"
Else
cmdCheckHardwareHandle.Text = "Lost"
End IfThis method returns the software version of the DLL.
int _stdcall icsneoGetDLLVersion();Public Declare Function icsneoGetDLLVersion Lib “icsneo40.dll” () As Integer[DllImport(“icsneo40.dll”)] public static extern int icsneoGetDLLVersion();Parameters
None.
Return Values
This function returns the version number of the API.
Remarks
None.
char szOut[200];
// get the DLL version and report it
wsprintf(szOut,TEXT("intrepidcs API DLL Version %d\n"), icsneoGetDLLVersion());
MessageBox(hWnd,szOut,TEXT("Message"),MB_ICONINFORMATION);'// get the DLL version information and place in Button text
Button1.Text = "Version " + Convert.ToString(icsneoGetDLLVersion)'// get the DLL version information and place in Button text
Button1.Text = "Version " + Convert.ToString(icsNeoDll.icsneoGetDLLVersion());This method starts the TCP/IP socket server at a specified port.
int _stdcall icsneoStopSockServer(int hObject);Public Declare Function icsneoStopSockServer Lib “icsneo40.dll” (ByVal hObject As Integer) As Integer[DllImport(“icsneo40.dll”)] public static extern int icsneoStopSockServer(int hObject);Parameters
hObject
[in] Handle to the driver object created by OpenNeoDevice
Return Values
If the server has been stopped successfully the return value will be 1. If the function fails the return value will be zero.
Remarks
This method should be called when the server created with StartSocketServer.
icsneoStopSockServer(hObject);bStatus = icsneoStopSockServer(m_hObject) '// stop the socket serveriStatus = icsNeoDll.icsneoStopSockServer(m_hObject); // stop the socket serverUsed to determine if an hObject reference is valid
Returns DLL version information
Starts the TCP/IP socket server at a specified port.
Stops the TCP/IP socket server
This method sets bit rates for networks on neoVI devices
Parameters
hObject __ [in] Specifies the driver object created by OpenNeoDevice. gptpStatus [out] The address of a GPTPStatus structure.
Return Values
1 if the function succeeded. 0 if it failed for any reason. GetLastAPIError must be called to obtain the specific error. Failure could include the device not supporting gPTP, or the device supports gPTP but not support icsneoGetGPTPStatus API. Remarks
Rad Galaxy, Rad SuperMoon, Rad Star2, and Rad GigaStar supports icsneoGetGPTPStatus API nEAT, Rad Pluto, Rad Jupiter support gPTP but, does not support this API
Public Declare Function icsneoGetGPTPStatus Lib "icsneo40.dll" (ByVal hObject As IntPtr, ByRef StatusGPTP As GPTPStatus) As Int32Dim gptp_status As New GPTPStatus
Dim iResult As Int32
iResult = icsneoGetGPTPStatus(m_hObject, gptp_status)int _stdcall icsneoGetGPTPStatus(void * hObject, GPTPStatus * StatusGPTP);[DllImport("icsneo40.dll")]
public static extern Int32 icsneoGetGPTPStatus(IntPtr hObject,ref GPTPStatus StatusGPTP);GPTPStatus gptp_status = {};
int iResult;
iResult = icsneoGetGPTPStatus(m_hObject, &gptp_status);GPTPStatus gptp_status = new GPTPStatus();
int iResult;
iResult = icsNeoDll.icsneoGetGPTPStatus(m_hObject,ref gptp_status);This method enables or disables the Ethernet activation line on supported hardware devices.
int _stdcall icsneoEnableDOIPLine(void* hObject, bool bActivate);Public Declare Function icsneoEnableDOIPLine Lib “icsneo40.dll” (ByVal hObject As IntPtr, ByVal bActivate As Boolean) As Int32[DllImport(“icsneo40.dll”)] public static extern Int32 icsneoEnableDOIPLine(IntPtr hObject, bool bActivate);Parameters
hObject
[in] Specifies the driver object created by OpenNeoDevice
bActivate
[in] Specifies the state of the Activation line. True enables the activation and False disabled it.
Return Values
1 if the function succeeded. 0 if it failed for any reason. GetLastAPIError must be called to obtain the specific error.
Remarks
The specified hardware must support a DoIP activation line
int iRetVal;
bool bState;
bState = true;
iRetVal = icsneoEnableDOIPLine(hObject,bState);
if(iRetVal == 0)
{
printf("\nFailed to set DoIP Act");
}
else
{
printf("\nSuccessfully set DoIP Act");
}int iResult;
bool bState;
//Set the bit rate
iResult = icsNeoDll.icsneoEnableDOIPLine(m_hObject,bState);
if (iResult == 0)
{
MessageBox.Show("Problem setting DoIP Act");
}Dim iResult As Integer
Dim bState As Boolean
'//Set the bit rate
iResult = icsneoEnableDOIPLine(m_hObject,bState)
If (iResult = 0) Then MsgBox("Problem setting DoIP Act")Parameters
hObject
[in] Specifies the driver object created with the OpenPort method.
iBufferCount
[out] Specifies the driver object created with the OpenPort method.
IBufferMax
[out] Specifies the size of the buffer.
iOverFlowCount
[out] Indicates the the number of overflows that have occurred since the last successful OpenPort method was called.
iReserved1
[out] Reserved. Set to 0.
iReserved2
[out] Reserved. Set to 0.
iReserved3
[out] Reserved. Set to 0.
iReserved4
[out] Reserved. Set to 0.
iReserved5
[out] Reserved. Set to 0.
Return Values
This function returns the 1 when successful. 0 if otherwise.
Remarks
XX.
icsneoGetPerformanceParameters(m_hObject, &iBufferCount, &iBufferMax, &iOverFlowCount, &iReserved1, &iReserved2, &iReserved3, &iReserved4, &iReserved5);lResult = icsneoGetPerformanceParameters(m_hObject, iBufferCount, iBufferMax, iOverFlowCount, iReserved1, iReserved2, iReserved3, iReserved4, iReserved5)
If CBool(lResult) Then
txtBufferCount.Text = iBufferCount
txtBufferMax.Text = iBufferMax
txtOverflowCount.Text = iOverFlowCount
End IflResult = icsNeoDll.icsneoGetPerformanceParameters(m_hObject, ref iBufferCount, ref iBufferMax, ref iOverFlowCount, ref iReserved1, ref iReserved2, ref iReserved3, ref iReserved4, ref iReserved5);
if(lResult=1)
{
txtBufferCount.Text = Convert.ToString(iBufferCount);
txtBufferMax.Text = Convert.ToString(iBufferMax);
txtOverflowCount.Text = Convert.ToString(iOverFlowCount);
}Public Declare Function icsneoGetPerformanceParameters Lib “icsneo40.dll” (ByVal hObject As IntPtr, ByRef iBufferCount As Integer, ByRef iBufferMax As Integer, ByRef iOverFlowCount As Integer, ByRef iReserved1 As Integer, ByRef iReserved2 As Integer, ByRef iReserved3 As Integer, ByRef iReserved4 As Integer, ByRef iReserved5 As Integer) As Integerint _stdcall icsneoGetPerformanceParameters(void * hObject, int * iBufferCount, int * iBufferMax, int * iOverFlowCount, int * iReserved1, int * iReserved2,int * iReserved3,int * iReserved4,int * iReserved5)[DllImport(“icsneo40.dll”)] public static extern int icsneoGetPerformanceParameters(IntPtr hObject,ref int iBufferCount, ref int iBufferMax, ref int iOverFlowCount , ref int iReserved1, ref int iReserved2 , ref int iReserved3, ref int iReserved4 ,ref int iReserved5);This method allows reading and writing the PHY settings from/to the hardware.
int _stdcall icsneoReadWritePHYSettings(void * hObject, PhyRegPkt_T *PHYSettings, size_t Size, size_t NumEntries);Public Declare Function icsneoReadWritePHYSettings Lib “icsneo40.dll” (ByVal hObject As IntPtr, ByRef PHYSettings As PhyRegPkt_T, ByVal iSize As IntPtr, ByVal NumEntries As IntPtr) As Int32[DllImport(“icsneo40.dll”)] public static extern Int32 icsneoReadWritePhySettings(IntPtr hObject, ref PhyRegPkt_T PHYSettings, IntPtr iSize, IntPtr NumEntries);Parameters
hObject
[in] Specifies the driver object created by OpenNeoDevice.
PHYSettings
[out] This is the address of the first element of an array of PhyRegPkt_T structures. This array will be loaded by the application software with entries to be read or written from/to the hardware.
iSize
[in] Specifies the size of the structure PhyRegPkt_T used by the application. This is to make sure the structure used in the application and the DLL is same to avoid any buffer overrun.
iNumEntries
[in] Specifies the number of PHY Entries to be read or written.
Return Values
Returns 1 if successful, 0 if an error occurred. GetLastAPIError must be called to obtain the specific error.
Remarks
This function call sends the PHY Entries to be read or written from/to the hardware.
PhySettings.clause22.phyAddrOrPort = 0x6;
PhySettings.clause.regAddr = 0x2;
PhySettings.clause.pageOrDevice = 1;
PhySettings.WriteEnable = 0;
PhySettings.Enabled = 1; //if not enabled, this entry of read/write operation will be ignored even if it is passed in.
PhySettings.Clause45Enable = 0; //Set this to 1 if the application is sending Clause45 type of Entries.
icsneoReadWritePHYSettings(handle, &PhySettings, sizeof(PhyRegPkt_t), 1);Int32 iResult;
PhyRegPkt_t PhyRegPkt;
int iTempFlags = 0;
//Copy data to the structure
PhyRegPkt.ClausePkt.phyAddrOrPort = 6;
PhyRegPkt.ClausePkt.pageOrDevice = 1;
PhyRegPkt.ClausePkt.regAddr = 2;
PhyRegPkt.ClausePkt.regVal = 0;
//Set for Reading using Clause45 and Enabled
iTempFlags = iTempFlags | (int)PhyRegFlags.Enabled;
iTempFlags = iTempFlags | (int)PhyRegFlags.Clause45Enable;
PhyRegPkt.Flags = (ushort)iTempFlags;
//Get and cast the size of the structrue.
iResult = icsNeoDll.icsneoReadWritePHYSettings(m_hObject, ref PhyRegPkt, (IntPtr)System.Runtime.InteropServices.Marshal.SizeOf(PhyRegPkt), (IntPtr)1);
System.Diagnostics.Debug.WriteLine(Convert.ToString(PhyRegPkt.ClausePkt.regVal));Dim iResult As Int32
Dim PhyRegPkt As PhyRegPkt_t
Dim iTempFlags As Int32 = 0
Dim iParamCount As IntPtr = CType(1, IntPtr)
'//Copy data to the structure
PhyRegPkt.ClausePkt.phyAddrOrPort = 6
PhyRegPkt.ClausePkt.pageOrDevice = 1
PhyRegPkt.ClausePkt.regAddr = 3
PhyRegPkt.ClausePkt.regVal = 0
'//Set for Reading using Clause45 and Enabled
iTempFlags = iTempFlags Or PhyRegFlags.Enabled
iTempFlags = iTempFlags Or PhyRegFlags.Clause45Enable
PhyRegPkt.Flags = CUShort(iTempFlags)
'//Get and cast the size of the structrue.
Dim PhyRegSize As IntPtr = CType(System.Runtime.InteropServices.Marshal.SizeOf(PhyRegPkt), IntPtr)
iResult = icsneoReadWritePHYSettings(m_hObject, PhyRegPkt, PhyRegSize, iParamCount)
Debug.Print(CStr(PhyRegPkt.ClausePkt.regVal))