Yet another iPort thread....
jjames
Posts: 2,908
Since I can't get the Duet version to work at all, I've been using the NetLinx version with a lot of success. Here's my problem: 18 touch panels are getting updated continuously and causing a lot of traffic. Isn't there any way to stop the updating? Such as disconnecting each panel in the TP array from the module / feedback?
0
Comments
DEFINE_FUNCTION CHAR Update Device Combine (DEV dvVirtual, DEV dvDevice, DEV dvDevArray[], CHAR cAddMode) { STACK_VAR LONG nNewIndex ; STACK_VAR DEV dvTempArray[MAX_NUMBER_TPS] ; STACK_VAR LONG nCount ; SWITCH(cAddMode) { CASE TRUE : { nNewIndex = (LENGTH_ARRAY(dvDevArray) + 1) ; SET_LENGTH_ARRAY(dvDevArray, nNewIndex) ; dvDevArray[nNewIndex] = dvDevice ; COMBINE_DEVICES(dvVirtual, dvDevArray) ; } CASE FALSE : { UNCOMBINE_DEVICES(dvVirtual) ; FOR(nCount = 1, nNewIndex = 0; nCount <= LENGTH_ARRAY(dvDevArray); nCount++) { IF(dvDevArray[nCount] <> dvDevice) { nNewIndex ++ ; dvTempArray[nNewIndex] = dvDevArray[nCount] ; } } dvDevArray = dvTempArray SET_LENGTH_ARRAY(dvDevArray, nNewIndex) ; SET_LENGTH_ARRAY(dvTempArray, nNewIndex) ; IF(LENGTH_ARRAY(dvTempArray)) COMBINE_DEVICES(dvVirtual, dvTempArray) ; } } RETURN cAddMode ; }It's a nice function Dave, very clean and elegantly simple!
Also, it didn't matter if I only had 1 TP or 13 TPs being updated, it was slow as molasses. Streamlining some code helped. Just another reason to rewrite the code!