Our full technical support staff does not monitor this forum. If you need assistance from a member of our staff, please submit your question from the Ask a Question page.


Log in or register to post/reply in the forum.

CR5000 strain gauge soft: max 4 possible, need 8+


JBK1Hardi Sep 11, 2013 02:09 PM

Hi,
My task is to modify existing software to be able to use 8 or more strain gauges simultaneously.
At present I am able to use 4 after which the program compiles with error: "Max xchan exceeded" L68+L90

Program:

' Program name: SG_1_20.CR5
' Written by: Name
' I.D. number: Number
' Date written: 10-11-2004
' Time written: 15:53:34
' PC5GEN Version: 4.10

'This program was generated using Campbell Scientific's PC5GEN
'program generator for the CR5000 Measurement & Control System.

'\\\\\\\\\\\\\\\\\\\\\\\ TIMING CONSTANTS ///////////////////////

Const PERIOD = 50 'Scan interval number
Const P_UNITS = 1 'Scan interval units (mSecs)

Const INTERVAL1 = 50 'Table 1 interval number
Const UNITS1 = 1 'Table 1 interval units (mSecs)

'\\\\\\\\\\\\\\\\\\\\\\\ BRIDGE CONSTANTS ///////////////////////

'________________________ Bridge Block 1 ________________________
Const BRNG1 = 50 'Block1 measurement range (Auto)
Const BREP1 = 4 'Block1 repetitions
Const BEXCIT1 = 5000 'Block1 excitation mVolts
Const BSETL1 = 200 'Block1 settling time (usecs)
Const BINT1 = 11000 'Block1 integration time (usecs)
Const BGF1 = -2.14 'Block1 gauge factor
Const BCODE1 = 1 'Block1 gauge code for 1/4 bridge strain
Const BMULT1 = 1 'Block1 default multiplier
Const BOSET1 = 0 'Block1 default offset
Public BBlk1(BREP1) 'Block1 dimensioned source
Dim GBBlk1(BREP1) 'Block1 dimensioned gauge factor
Dim BBlk1ZeroMv(BREP1) 'Block1 zero mV variable
Dim BBlk1ZeroUs(BREP1) 'Block1 zero uStrain variable
Units BBlk1ZeroMv = mVperV 'Block1 default units (mVperV)
Units BBlk1ZeroUs = uStrain 'Block1 default units (uStrain)
Units BBlk1 = uStrain 'Block1 default units (uStrain)

'\\\\\\\\\\\\\\\\\\ ALIASES & OTHER VARIABLES //////////////////

Public Flag(8) 'General Purpose Flags
Dim I 'Declare I as a variable
Dim Count 'Declare Count as a variable
Dim ReadPort 'Declare ReadPort (1-8) variable

'\\\\\\\\\\\\\\\\\\\\\\\\ OUTPUT SECTION ////////////////////////

'---------------------------- Table 1----------------------------
DataTable(STR1_20,True,-1) 'Trigger, auto size
DataInterval(0,INTERVAL1,UNITS1,0) '50 mSec interval, 0 lapses, autosize
CardOut(0,-1) 'PC card , size Auto
'_______________________ Bridge Blocks _______________________
Sample (BREP1,BBlk1(),FP2) '1 Reps,Source,Res
EndTable 'End of table STR1_20

'--------------- Store zero values from Sub Zero8 ---------------
DataTable(ZERO_8,Count>99,100) 'Trigger on Count 100
Average(BREP1,BBlk1ZeroMv(),IEEE4,False)'1 Reps,Source,Res,Enabled
Average(BREP1,BBlk1ZeroUs(),IEEE4,False)'1 Reps,Source,Res,Enabled
EndTable 'End of table ZERO_8

'\\\\\\\\\\\\\\\\\\\\\\\\\\ SUBROUTINES //////////////////////////

Sub Zero8 'Begin zero measure routine
Count = 0 'Set Count to zero
Scan(PERIOD,P_UNITS,0,100) 'Scan 100 times. 5.00 Seconds.
BrFull(BBlk1ZeroMv(),BREP1,BRNG1,1,VX1,1,BEXCIT1,False,False,BSETL1,BINT1,BMULT1,BOSET1) 'Strain
StrainCalc(BBlk1ZeroUs(),BREP1,BBlk1ZeroMv(),0,BCODE1,GBBlk1(),0)
Count = Count + 1 'Increment Count
CallTable ZERO_8 'Go up and run Table ZERO_8
Next Scan 'Loop up for the next scan
For I = 1 To BREP1 'Do this 1 times
BBlk1ZeroMv(I) = ZERO_8.BBlk1ZeroMv_Avg(I,1)
Next I 'Do it again
Flag(8) = False 'Reset Flag(8)
EndSub 'End gauge zero measure routine

'\\\\\\\\\\\\\\\\\\\\\\\\\\\\ PROGRAM ////////////////////////////

BeginProg 'Program begins here
'MainSequence
For I = 1 To BREP1 'Do the following to all of BBlk1
GBBlk1(I) = BGF1 'Assign default gauge factor (2) to GBBlk1
Next I 'Repeat above until finished
Scan(PERIOD,P_UNITS,0,0) 'Scan once every 50 mSecs, non-burst
'_________________________ Port Control _________________________
ReadIO(ReadPort,&H1) 'Destination, mask
'________________________ Bridge Blocks ________________________
BrFull(BBlk1(),BREP1,BRNG1,1,VX1,1,BEXCIT1,False,False,BSETL1,BINT1,BMULT1,BOSET1) 'Strain
StrainCalc(BBlk1(),BREP1,BBlk1(),BBlk1ZeroMv(),BCODE1,BGF1,0) 'Strain calculation
If Flag(8) Then Zero8 'Go do Zero8 subroutine

'______________________ Output Table Control ______________________
If ReadPort > 0 Then CallTable STR1_20
Next Scan 'Loop up for the next scan
EndProg 'Program ends here

'***** Program End *****

* Last updated by: JBK1Hardi on 9/11/2013 @ 8:10 AM *


rlwoell Sep 11, 2013 03:46 PM

The problem is that the program tells the logger that only one strain gage is excited on each of the excitation channels, four gages, each connected to a separate excitation channel. You need to excite more than one gage on each excitation channel.

Below is the BrFull instruction that causes two gages to be excited on each excition channel. Note that the "1" following "VX1" has been changed to a "2".

BrFull(BBlk1ZeroMv(),BREP1,BRNG1,1,VX1,2,BEXCIT1,False,False,BSETL1,BINT1,BMULT1,BOSET1)

You then wire the first two gages to VX1, the next two to VX2 etc.

Below is cut from the help section for the BrFull instruction and also addresses the power budget calculation.

MeasPEx

The number of sensors to excite with the same excitation channel before automatically advancing to the next excitation channel. To excite all sensors with the same excitation channel, the value of this parameter should be set equal to the value of the Reps parameter.

This parameter in a bridge measurement can be used when the sensors to be measured outnumber the available excitation channels. It allows multiple sensors to be excited with each excitation channel.

For example, assume it is desired to measure eight pressure transducers that have 350 ohm full bridge strain gages to be excited by 5 volts. Each transducer requires 14 mA (5 volts/350 ohms = 14 mA). Since each excitation channel can provide a maximum of 50 mA at 5 volts, a maximum of 3 pressure transducers can be excited per channel (50 mA/14 mA = 3.57). To measure the eight transducers, 8 would be entered for the Reps argument and 3 for the MeasPEx. The first three transducers would all be connected to the first excitation channel, the next 3 to the second excitation channel, and the last 2 to the third excitation channel.

Type: Constant (or expression that evaluates as a constant)


JBK1Hardi Sep 12, 2013 01:42 PM

It's working... X8
Nice - Thanks mate!

Log in or register to post/reply in the forum.