The Process you've created doesn't have any internal states, so it can only create very uninteresting outputs. Let's add some state variables now, and get some dynamics going.

Keeping a state

Modify your source file as follows, to add a state, initialise it, and output it on one of our two output channels.

C++ Source Code (against 1199)
// an (numeric) output port numeric::Output output;
// our internal state
DOUBLE currentMembranePotential;
C++ Source Code (against 1199)
// extract DataML EventStateSet* data = (EventStateSet*) event->data; XMLNode xmlNode(hComponent, data->state); DataMLNode nodeState(&xmlNode);
// initialise our internal state
currentMembranePotential = 0.5;
// ok return C_OK;
C++ Source Code (against 1199)
// it's got two elements, so let's write them both
p[0] = currentMembranePotential;
p[1] = time->now;
Matlab Console
>> test Columns 1 through 7 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 Columns 8 through 10 0.5000 0.5000 0.5000 7.0000 8.0000 9.0000

Good, now we've got an internal state, and we're sending it out on our output port. Now let's add some dynamics.

Modifying internal state

This is going to be the cell's membrane potential (which we'll model as being between zero and one, so it doesn't get too neuroscience-y). Let's implement its decay back towards zero. We'll also make the sample rate a bit more realistic, moving from 10Hz to 1000Hz, and run for a quarter of a second, so we get some nice behaviour displayed. We'll get 250 samples logged, now, so we'll plot the output log instead of just displaying it to console. Modify source file and test script as shown below.

M Source Code (against 995)
% add process state = [];
fS = 1000;
cls = 'dev/quickstart/1199'; sys = sys.addprocess('neuron', cls, fS, state);
M Source Code (against 995)
% execution exe = brahms_execution; exe.all = true; exe.name = 'process';
exe.stop = 0.25;
M Source Code (against 995)
% show output
t = ((1:length(out.neuron.out))-1)/fS;
plot(t, out.neuron.out(1, :))
xlabel('time (seconds)');
ylabel('membrane potential (unitless)')

(The t=... stuff just makes sure the plot is in seconds...)

C++ Source Code (against 1199)
// run dynamics
DOUBLE tau = 0.01; /* 10mS membrane time constant */
DOUBLE fS = sampleRateToRate(time->sampleRate);
DOUBLE lambda = exp(-1.0/(tau * fS));
currentMembranePotential *= lambda;
// get a pointer to the port's contents (actual numeric data) DOUBLE* p = (DOUBLE*) output.getContent();

Which should generate a plot something like this one.

Where do I go from here?

This is entirely up to you. You can keep as much state as you like, in the same way as shown above.