You are here: Foswiki>Machines Web>MachineUNILAC>InterlockSystem>TestSetup (13 Jun 2024, TobiasHabermann)Edit Attach

Test Setup

06.06.2024 - Softwarelabor

20240606_093422.jpg

scuxl0646

schreiben und lesen des echo registers

via eb-tools
   eb-write dev/wbm0 0x420800/2 0xcafe
   eb-write dev/wbm0 0x420802/2 0x1310

   eb-write dev/wbm0 0x421802/2 0x8910
   eb-read dev/wbm0 0x421a02/2   > /dev/null

via FeSupport::MilSupport::Ifb

void simple_example(FeSupport::MilSupport::MilAccess SIO_no,unsigned MIL_addr) {
   auto busAdapterFactory = boost::make_shared<FeSupport::Scu::BusAdapters::BusAdapterFactory> (SIO_no);
   boost::shared_ptr<FeSupport::MilSupport::Ifb> ifb = boost::make_shared<FeSupport::MilSupport::Ifb>(busAdapterFactory, MIL_addr);
   if (ifb->onlineTest() == false) return;

   ifb->mil()->setDebug(true);
   std::cout << ifb->configInfo() << "\n";

   uint16_t word = 0xcafe;
   ifb->writeData(IFB_ECHO_WRITE, word);
   uint16_t echo;
   auto complStat = ifb->readData(IFB_ECHO_READ, echo);
   std::cout << ifb->configInfo() << " write : " << std::hex << word << " read  : " << echo;
   if (complStat & 1) { std::cout << " ok\n"; }
   else { std::cout << " err" << std::hex << complStat << std::dec << "\n"; }
}

Example output (SIO_1,milslave address 0x10):

/home/bel/thaberm/lnx/workspace9/feSupport/feSupport/milSupport/Ifb.cpp::Ifb:41 Fg900_151 created for ifb 16
 IFB-Adr: 16 Online ID: fb00(FG380.211) EPLD: 0x600 GrpCnt: 1 Mode: 0
/home/bel/thaberm/lnx/workspace9/feSupport/feSupport/scu/etherbone/EtherboneConnection.cpp::doVectorWrite::928: format 0x12 addr 0x420800 data[0] 0xcafe
/home/bel/thaberm/lnx/workspace9/feSupport/feSupport/scu/etherbone/EtherboneConnection.cpp::doVectorWrite::928: format 0x12 addr 0x420802 data[1] 0x1310
/home/bel/thaberm/lnx/workspace9/feSupport/feSupport/scu/etherbone/EtherboneConnection.cpp::doWrite::870 addr 0x4219e0 data 0x8910
/home/bel/thaberm/lnx/workspace9/feSupport/feSupport/scu/etherbone/EtherboneConnection.cpp::doVectorRead::848: format 0x12 addr 0x421c1e data[0] 0x1
/home/bel/thaberm/lnx/workspace9/feSupport/feSupport/scu/etherbone/EtherboneConnection.cpp::doVectorRead::848: format 0x12 addr 0x421c3e data[1] 0x0
/home/bel/thaberm/lnx/workspace9/feSupport/feSupport/scu/etherbone/EtherboneConnection.cpp::doRead::773 addr 0x421be0 data 0xcafe
 IFB-Adr: 16 Online ID: fb00(FG380.211) EPLD: 0x600 GrpCnt: 1 Mode: 0 write : cafe read  : cafe ok
-- TobiasHabermann - 06 Jun 2024
Topic revision: r4 - 13 Jun 2024, TobiasHabermann
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback