Discussion:
Higher code execution time for PXI HSDIO 6541 than the PXI 6534 card
(too old to reply)
Loka Prakash
2008-08-13 11:10:08 UTC
Permalink
Hi I am using PXI 6534 card initially for digital signals generation and acquistion across various channels using the NI-DAQmx library functions (Static I/O method, DAQmxWriteDigitalLines, DAQmxReadDigitalLines etc).The execution time of the code module developed is observed to be around 80 -120millisecondsThe PXI System details:  Chassis Model - PXI-1006.                                         Embedded Controller module - PXI-8186                                         with CVI - 7.1, DAQmx 8.6 The same set of code when i run on different PXI with the HSDIO 6541 module, the execution time is observed to be around 2 seconds (with the Static Generation concept)(which is comparatively very higher than earlier, I need the execution to happen in few mS)The PXI System Details: Chassis Model - PXI-1045                                         Embedded Controller Module - PXI 8106                                         with CVI 8.5, DAQmx 8.7.1 I would like to know, if i am missing any information or things to be taken care in migrating to this new PXI sytem with 6541 Please let me know the factors which may cause this behaviour Thanks in advance. Regards,Prakash   
JuanCarlos
2008-08-13 14:40:10 UTC
Permalink
Prakash, Just to clarify, are you using the DAQmx static read and write functions with the 6541? or did you re-write your code using the HSDIO driver? For the 6541 you should be using the HSDIO functions; since static I/O is software timed, you can expect to see differences in performance based on the system and the device but seems strange to go from a mSec to Secs. Could you post more details about your code? Juan Carlos 
Loka Prakash
2008-08-14 04:10:07 UTC
Permalink
Hi Juan, Thanks for the reply. You  are right regarding the Static I/O operation whcih are software timed. I have used DAQmx Static Read and Write Functions (DAQmxWriteDigitalLines, DAQmxReadDigital Lines functions) with the 6541 andI tried the Static HSDIO fucntions (niHSDIO_ReadStaticU32, niHSDIO_WriteStaticU32 fucntions) as well, Both the options did not help regarding the speed of execution (both are executing at almost same speed) I have tried the Static Generation (which generates static data on specifed channels, I have looped it for 100 times) example from NI->Example FinderIn this case also the execution time is around 2 to 4 seconds. Thanks and regrads,Prakash    
lion-o
2008-08-15 00:40:19 UTC
Permalink
Hi Prakash, Where did you place the loop in the example?  You should make sure it's just around the WriteStaticU32 function only. Can you try putting the 6534 in the new system to see if that also takes around 2 seconds in the system? Do you have the same version of NI-HSDIO installed on both controllers? If not can you do so and then re-run the tests for both cards on both systems? Have you tried running the 6541 in the original system? We need to remove as many variables as possible to find out where the issue is coming into play. If your 6534 is also significantly slower in your new system then could you also provide some additional information about your PXI controllers. For instance what Operating Systems are they running (is the 8106 running Vista and is the 8186 running Phar Lap)? How much system memory do you have in each controller? Windows Vista running with only 512 MB of RAM could legitimately be running slower and effect the software timing. Thanks Prakash and I look forward to hearing from you!
JuanCarlos
2008-08-15 21:10:07 UTC
Permalink
Hi Prakash, I opened the HSDIO example "StaticGenerationAndAcquisition.c" and added some code to loop around and measure the time it takes to execute 1000 reads and writes. I'm seeing 480 mSec on average for the reads/writes to execute. I have a system that should be comparable to your setup. Here's the code that I'm using, please give this a try in you system and let us know what numbers you get.  Regards, Juan Carlos  



/* Includes */
#include
#include "niHSDIO.h"

int main(void)
{
/* Execution parameters */
ViRsrc deviceID = "PXI1Slot2";
ViConstString channelList = "0-15";

ViUInt32 writeData = 0x4321;
ViUInt32 channelMask = 0xFFFF; /* all channels */
ViInt32 genVoltageLogicFamily = NIHSDIO_VAL_3_3V_LOGIC;

ViUInt32 readData = 0;
ViInt32 acqVoltageLogicFamily = NIHSDIO_VAL_3_3V_LOGIC;
ViInt32 i=0;
double startTime=0, endTime=0;

/* Context parameters */
ViSession oSes = VI_NULL;
ViSession iSes = VI_NULL;
ViStatus error = VI_SUCCESS;
ViChar oErrDesc[1024];
ViChar iErrDesc[1024];


/* Initialize both sessions */
checkErr(niHSDIO_InitGenerationSession(
deviceID, VI_FALSE, VI_FALSE, VI_NULL, &oSes));

checkErr(niHSDIO_InitAcquisitionSession(
deviceID, VI_FALSE, VI_FALSE, VI_NULL, &iSes));

/* Assign channels for static operation */
checkErr(niHSDIO_AssignStaticChannels(oSes, channelList));
checkErr(niHSDIO_AssignStaticChannels(iSes, channelList));

/* Configure generation voltage */
checkErr(niHSDIO_ConfigureDataVoltageLogicFamily(
oSes, channelList, genVoltageLogicFamily));

/* Configure acquisition voltage */
checkErr(niHSDIO_ConfigureDataVoltageLogicFamily(
iSes, channelList, acqVoltageLogicFamily));

GetCurrentDateTime (&startTime);

for (i=0; i<1000; i++)
{
/* Write static data with channel mask */
checkErr(niHSDIO_WriteStaticU32(oSes, writeData, channelMask));

/* Read back static data */
checkErr(niHSDIO_ReadStaticU32(iSes, &readData));
}

GetCurrentDateTime (&endTime);

printf("\n Elapsed Time = %f\n\n", endTime-startTime);

Error:

if (error == VI_SUCCESS)
{
/* print result */
printf("Done without error.\n");
printf("Data written (channel mask 0x%.4X) = 0x%X \n", channelMask, writeData);
printf("Data read = 0x%X \n", readData);
}
else
{
/* Get error description and print */
niHSDIO_GetError(oSes, &error, sizeof(oErrDesc)/sizeof(ViChar), oErrDesc);
niHSDIO_GetError(iSes, &error, sizeof(iErrDesc)/sizeof(ViChar), iErrDesc);

printf("\nError encountered\n===================\n%s%s\n", oErrDesc, iErrDesc);
}

/* close both sessions */
niHSDIO_close(iSes);
niHSDIO_close(oSes);

/* prompt to exit (for pop-up console windows) */
printf("\nHit to continue...\n");
getchar();

return error;
}

Loading...