Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions pmacApp/pmc/trajectory_scan_ppmac.pmc
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,8 @@ Version->*d
global PVT_Time
global UserCmd

global CalculatedBase // Calculated temporary variable for Current base address
global CalculatedBaseInt // Calculated temporary variable for Current base address
global CalculatedBaseDouble // Calculated temporary variable for Current base address

// *****************************************************************************************
// Set the version number
Expand Down Expand Up @@ -222,6 +223,12 @@ CurrentBufferAdr = BufferAdr_A // Set CurrentBuffer values to buffer A
CurrentBufferFill = BufferFill_A
CurrentBuffer = 0

// Convert absolute address to the index of integer data in the user shared memory buffer (USHM)
CalculatedBaseInt = CurrentBufferAdr/ _SIZEOF_INTEGER_;
// Convert absolute address to the index of double data in the user shared memory buffer (USHM)
CalculatedBaseDouble = CurrentBufferAdr/ _SIZEOF_DOUBLE_;


PrevBufferFill = BufferLength // Set PrevBufferFill to pass outer while loop condition

GoSub101 // Check which axes are required
Expand Down Expand Up @@ -262,6 +269,9 @@ While(AbortTrigger == 0 && Error == 0 && CurrentBufferFill > 0 && PrevBufferFill
CurrentBufferFill = BufferFill_A
BufferFill_B = 0
}
CalculatedBaseInt = CurrentBufferAdr/ _SIZEOF_INTEGER_;
CalculatedBaseDouble = CurrentBufferAdr/ _SIZEOF_DOUBLE_;

// Move to final point of buffer if next buffer has points
If(AbortTrigger == 0 && CurrentBufferFill > 0) // Do move with previous buffer N-1 and N and current buffer 1
{
Expand Down Expand Up @@ -382,14 +392,12 @@ Return
// *************************************************************************************************

N103:
// Convert absolute address to the index of integer data in the user shared memory buffer (USHM)
CalculatedBase = CurrentBufferAdr/ _SIZEOF_INTEGER_;
// Integer type buffers
Time_Idx = CalculatedBase + CurrentIndex
Time_Idx = CalculatedBaseInt + CurrentIndex
User_Idx = Time_Idx + BuffLen
// Double type buffers
// Convert index of integer data to double data in USHM
A_Idx = (User_Idx + BuffLen) * _SIZEOF_INTEGER_ / _SIZEOF_DOUBLE_
A_Idx = CalculatedBaseDouble + BuffLen + CurrentIndex
B_Idx = A_Idx + BuffLen
C_Idx = B_Idx + BuffLen
U_Idx = C_Idx + BuffLen
Expand Down