{
    "$App": {
        "Class": "RealTimeApplication",
        "+Data": {
            "Class": "ReferenceContainer",
            "+RTTimer": {
                "Class": "LinuxTimer",
                "SleepNature": "Busy",
                "CPUMask": 2,
                "Locked": 1,
                "Signals": {
                    "Counter": {
                        "Type": "uint32"
                    },
                    "Time": {
                        "Type": "uint32"
                    }
                }
            },
            "+Timing": {
                "Class": "TimingDataSource",
                "Locked": 1
            },
            "+DDB0": {
                "Class": "GAMDataSource",
                "Locked": 1,
                "Signals": {
                    "Time": {
                        "Type": "uint32"
                    },
                    "Times": {
                        "Type": "uint32",
                        "NumberOfDimensions": 1,
                        "NumberOfElements": 3
                    },
                    "Amplitudes": {
                        "Type": "float32",
                        "NumberOfDimensions": 1,
                        "NumberOfElements": 3
                    }
                }
            },
            "+EpicsIn": {
                "Class": "EPICSCA::EPICSCAInput",
                "Locked": 1,
                "Signals": {
                    "Amplitude": {
                        "Type": "float32",
                        "PVName": "Amplitude"
                    },
                    "Frequency": {
                        "Type": "float32",
                        "PVName": "Frequency"
                    }
                }
            },
            "DefaultDataSource": "DDB0",
            "+Logger": {
                "Class": "OnChangeLoggerDataSource",
                "Locked": 1,
                "Signals": {
                    "Times": {
                        "Type": "uint32",
                        "NumberOfDimensions": 1,
                        "NumberOfElements": 3
                    },
                    "Amplitudes": {
                        "Type": "float32",
                        "NumberOfDimensions": 1,
                        "NumberOfElements": 3
                    }
                }
            }
        },
        "+Functions": {
            "+TimerGAM": {
                "Class": "IOGAM",
                "InputSignals": {
                    "Time": {
                        "Frequency": 100,
                        "DataSource": "RTTimer",
                        "Type": "uint32",
                        "Alias": "Time"
                    }
                },
                "OutputSignals": {
                    "Time": {
                        "DataSource": "DDB0",
                        "Type": "uint32",
                        "Alias": "Time"
                    }
                }
            },
            "+Chai": {
                "Class": "ChaiGAM",
                "Code": "global g = 4;\nfun() {\n\tg = g + 1;\n\ty[0] = -A;\n \ty[1] = A;\n\ty[2] = -A;\n\tt[0] = g;\n\tif (freq <= 0) {\n\t\tt[1] = 0;\n\t\tt[2] = 0;\n\t} else {\n\t\tt[1] = int(5e5 / freq);\n\t\tt[2] = int(1e6 / freq);\n\t}\n}",
                "InputSignals": {
                    "A": {
                        "DataSource": "EpicsIn",
                        "Type": "float32",
                        "Alias": "Amplitude"
                    },
                    "freq": {
                        "DataSource": "EpicsIn",
                        "Type": "float32",
                        "Alias": "Frequency"
                    }
                },
                "OutputSignals": {
                    "t": {
                        "NumberOfElements": 3,
                        "NumberOfDimensions": 1,
                        "DataSource": "DDB0",
                        "Type": "uint32",
                        "Alias": "Times"
                    },
                    "y": {
                        "NumberOfElements": 3,
                        "NumberOfDimensions": 1,
                        "DataSource": "DDB0",
                        "Type": "float32",
                        "Alias": "Amplitudes"
                    }
                }
            },
            "Class": "ReferenceContainer",
            "+LogGAM": {
                "Class": "IOGAM",
                "InputSignals": {
                    "t": {
                        "NumberOfElements": 3,
                        "NumberOfDimensions": 1,
                        "DataSource": "DDB0",
                        "Type": "uint32",
                        "Alias": "Times"
                    },
                    "y": {
                        "NumberOfElements": 3,
                        "NumberOfDimensions": 1,
                        "DataSource": "DDB0",
                        "Type": "float32",
                        "Alias": "Amplitudes"
                    }
                },
                "OutputSignals": {
                    "times": {
                        "NumberOfElements": 3,
                        "NumberOfDimensions": 1,
                        "DataSource": "Logger",
                        "Type": "uint32",
                        "Alias": "Times"
                    },
                    "amplitudes": {
                        "NumberOfElements": 3,
                        "NumberOfDimensions": 1,
                        "DataSource": "Logger",
                        "Type": "float32",
                        "Alias": "Amplitudes"
                    }
                }
            }
        },
        "+States": {
            "Class": "ReferenceContainer",
            "+Exec": {
                "Class": "RealTimeState",
                "+Threads": {
                    "+Comm": {
                        "Class": "RealTimeThread",
                        "CPUs": 1,
                        "Functions": [
                            "TimerGAM",
                            "Chai",
                            "LogGAM"
                        ]
                    },
                    "Class": "ReferenceContainer"
                }
            }
        },
        "+Scheduler": {
            "Class": "GAMScheduler",
            "TimingDataSource": "Timing"
        }
    }
}
