04-18-2014 04:52 AM
What session to pass to nxBlink() NI-XNET function ?
I tried to pass sessions obtained from:
- nxCreteSession(..., nxMode_FrameInStream, ...)
- nxCreteSession(..., nxMode_FrameOutStream, ...)
But I get error. The nxBlink() help only says use "The XNET Interface I/O name".
but that doesn' tell me what kind of session out of these to use:
nxMode_SignalInSinglePoint | 0 |
nxMode_SignalInWaveform | 1 |
nxMode_SignalInXY | 2 |
nxMode_SignalOutSinglePoint | 3 |
nxMode_SignalOutWaveform | 4 |
nxMode_SignalOutXY | 5 |
nxMode_FrameInStream | 6 |
nxMode_FrameInQueued | 7 |
nxMode_FrameInSinglePoint | 8 |
nxMode_FrameOutStream | 9 |
nxMode_FrameOutQueued | 10 |
nxMode_FrameOutSinglePoint | 11 |
nxMode_SignalConversionSinglePoint | 12 |
04-23-2014 02:06 AM
Hi,
It's not expecting a session name but the physical port name, like CAN1 or LIN2. Just wire a constant to the terminal and choose the right port if you have a XNET device connected to your computer (it will be in the list). If you're using a remote system, you must know the name of the port (MAX helps for this).
Regards,
Eric M. - Senior Software Engineer
Certified LabVIEW Architect - Certified LabVIEW Embedded Systems Developer - Certified LabWindows™/CVI Developer
Neosoft Technologies inc.
04-23-2014 03:01 AM
I already found out that system type of session leads to interface/port type of session that can be used
to blink the particular port LED.
Thank you, Radek
// Open system session.
nxCheckErr(nxSystemOpen(&l_SystemRef));
// Each Interface is represented by a u32 (4 bytes).
l_NumberOfInterfaces = l_PropertySize /4;
l_pInterfaceNames = (char**)malloc(sizeof(char*)*l_PropertySize);
l_InterfaceBuffer = (u32 **)malloc(l_PropertySize);
// This property returns the u32 value for each interface.
// You can use this value to get individual interface properties
nxCheckErr(nxGetProperty (l_SystemRef, nxPropSys_IntfRefs, l_PropertySize, l_InterfaceBuffer));
// Get the individual interface names.
for (i = 0; i < l_NumberOfInterfaces; i++)
{
nxCheckErr(nxGetPropertySize((nxSessionRef_t)(l_InterfaceBuffer[i]), nxPropIntf_Name, &l_PropertySize));
l_pInterfaceNames[i] = (char*) malloc(l_PropertySize);
nxCheckErr(nxGetProperty((nxSessionRef_t)l_InterfaceBuffer[i], nxPropIntf_Name, l_PropertySize, l_pInterfaceNames[i]));
// Identify the port that match the resourceDescriptor.
if (0 == strcmp(resourceDescriptor, l_pInterfaceNames[i]))
{
actualInterface = (nxSessionRef_t)l_InterfaceBuffer[i];
nxBlink(actualInterface, 1); // Blink particular port for identification and
Delay(1); // indicate that input stream was succesfully opened.
nxBlink(actualInterface, 0);
}
}